You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have removed any sensitive information from my code snippets and submission.
Amplify Hosting feature
Custom headers
Is your feature request related to a problem? Please describe:
Custom HTTP Pattern Not Matching Multiple Font Extensions in Amplify
Describe how you'd like this feature to work
Description:
I'm encountering an issue with custom headers in AWS Amplify when configuring them for multiple font file extensions using a pattern in the customHttp.yml file. While setting direct headers for individual extensions works, using a pattern with curly braces ({}) to match multiple extensions (e.g., **/*.{woff,woff2,ttf,otf,eot}) doesn't seem to apply the headers as expected.
Expected Behavior:
The custom header configuration should match files with any of the specified font extensions (woff, woff2, ttf, otf, eot) within the project directory structure and apply the defined headers (e.g., Cache-Control).
Actual Behavior:
The custom header is only applied to files with the exact extension listed first in the pattern (e.g., only .woff files in this case).
Steps to Reproduce:
Create a new Amplify project or use an existing one.
Add a customHttp.yml file to the project root directory.
Include a pattern like this in the customHttp.yml file, replacing the value with your desired caching settings:
customHeaders:
- pattern: "**/*.{woff,woff2,ttf,otf,eot}"headers:
- key: Cache-Controlvalue: max-age=86400, public # Example caching for fonts
Deploy the Amplify application.
Verify by inspecting network requests in browser developer tools. The custom headers might not be applied to font files with extensions other than the first listed one (e.g., .woff2, .ttf, .otf, or .eot).
Change headers to:
customHeaders:
- pattern: "**/*.woff2"headers:
- key: Cache-Controlvalue: max-age=86400, public # Example caching for fonts
Deploy the Amplify application.
Verify by inspecting network requests in browser developer tools. The custom headers will be applied to woff2 fonts.
Summary:
I've tried using a character class ([woff|woff2|ttf|otf|eot]) within the braces, but the behavior seems to be the same.
Setting direct headers for individual font extensions (e.g., **/*.woff, **/*.woff2) works as expected.
Questions:
Is there a known limitation with using patterns for multiple font file extensions in Amplify custom headers?
If so, are there any recommended workarounds or alternative approaches to achieve the desired behavior?
Could there be a configuration issue in my customHttp.yml file?
Thank you for your assistance!
The text was updated successfully, but these errors were encountered:
This has been identified as a feature request. If this feature is important to you, we strongly encourage you to give a 👍 reaction on the request. This helps us prioritize new features most important to you. Thank you!
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
Before opening, please confirm:
Amplify Hosting feature
Custom headers
Is your feature request related to a problem? Please describe:
Custom HTTP Pattern Not Matching Multiple Font Extensions in Amplify
Describe how you'd like this feature to work
Description:
I'm encountering an issue with custom headers in AWS Amplify when configuring them for multiple font file extensions using a pattern in the
customHttp.yml
file. While setting direct headers for individual extensions works, using a pattern with curly braces ({}
) to match multiple extensions (e.g.,**/*.{woff,woff2,ttf,otf,eot}
) doesn't seem to apply the headers as expected.Expected Behavior:
The custom header configuration should match files with any of the specified font extensions (woff, woff2, ttf, otf, eot) within the project directory structure and apply the defined headers (e.g.,
Cache-Control
).Actual Behavior:
The custom header is only applied to files with the exact extension listed first in the pattern (e.g., only
.woff
files in this case).Steps to Reproduce:
customHttp.yml
file to the project root directory.customHttp.yml
file, replacing the value with your desired caching settings:.woff2
,.ttf
,.otf
, or.eot
).Summary:
[woff|woff2|ttf|otf|eot]
) within the braces, but the behavior seems to be the same.**/*.woff
,**/*.woff2
) works as expected.Questions:
customHttp.yml
file?Thank you for your assistance!
The text was updated successfully, but these errors were encountered: