aws-amplify / aws-amplify/amplify-hosting

customHttp.yml file content not being applied in console

Open
#2,465 11 comments 2 reactions 0 assignees View on GitHub
bug custom-headers pending-prioritization
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-console/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-console/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-console/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

dtwb349cn82m8

### Region

eu-west-1

### Amplify Console feature

Custom headers

### Describe the bug

This is similar to https://github.com/aws-amplify/amplify-console/issues/1317, that was ultimately closed without a clear answer, but in this case, `customHttp.yml` file was already present at the time of App Creation in Amplify Console.

This is the `customHttp.yml` in the root of our repository:

```yml
customHeaders:
- pattern: '**/*'
headers:
- key: Cache-Control
value: max-age=86400
```

The box under "Custom Headers" in Amplify Console is empty (like it didn't recognize the `customHttp.yml` file in the repo) and obviously no custom headers are present in HTTP responses.

### Expected behavior

We expect Amplify Console to correctly recognize `customHttp.yml` file in repo, to correctly show its content under "Custom Headers" section and to correctly add custom headers to HTTP responses.

### Reproduction steps

N/A

### Build Settings

```yaml
version: 1
env:
variables:
_LIVE_UPDATES: [{"pkg":"@aws-amplify/cli","type":"npm","version":"latest"},{"pkg":"node","type":"nvm","version":"16.13.1"}]
backend:
phases:
preBuild:
commands:
build:
commands:
- amplifyPush --simple
postBuild:
commands:
frontend:
phases:
preBuild:
commands:
- yarn install
build:
commands:
- yarn run build
artifacts:
baseDirectory: build
discard-paths: yes
files:
- '**/*'
cache:
paths:
- node_modules/**/*
test:
phases:
preTest:
commands:
- yum install -y xorg-x11-server-Xvfb gtk2-devel gtk3-devel libnotify-devel GConf2 nss libXScrnSaver alsa-lib
- rm -rf node_modules
- yarn install --frozen-lockfile
- yarn add pm2@5.1.2 --dev
- yarn add wait-on@6.0.0 --dev
- yarn add mocha@9.1.3 mochawesome@7.0.1 mochawesome-merge@4.2.1 mochawesome-report-generator@6.0.1 --dev
- yarn run cypress:clean
- yarn run pm2 start 'yarn run start'
- yarn run wait-on https://localhost:3000
test:
commands:
- yarn run cypress run --reporter mochawesome --reporter-options 'reportDir=cypress/report/mochawesome-report,overwrite=false,html=false,json=true,timestamp=mmddyyyy_HHMMss'
postTest:
commands:
- yarn run mochawesome-merge cypress/report/mochawesome-report/*.json > cypress/report/mochawesome.json
- yarn run pm2 kill
artifacts:
baseDirectory: cypress
configFilePath: '**/mochawesome.json'
files:
- '**/*.png'
- '**/*.mp4'
```

### Additional information

N/A

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the deployment with the root-level customHttp.yml shown in the issue, then check the Amplify Console Custom Headers section and deployed HTTP responses. Compare the observed behavior with the expected customHeaders configuration; done means the file is recognized, its content appears in the console, and Cache-Control is present in responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.