-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom headers in custom origins #1448
Add support for custom headers in custom origins #1448
Conversation
Thanks, can you just make sure you are formatting the file according to prettier/eslint rules, so the codebase is consistent in style? We have git hooks via husky for that. Please ensure you are running them. Looks like the codacy analysis failed because of those? EDIT: also it looks like the tests are failing as well. Please fix and I will approve and merge. |
Will work on this when I get into the office. I'm not very familiar with the test suite being used (I normally don't develop much js/ts), so this might take me a bit 🙂 |
@dphang Both points should be fixed. Ironically, the linting issues I already had staged, just not committed, which was a bad on my part. The tests failing was a failure at my end when converting it to ts. |
Hm, the test I see failing seems to be related to the fix you just merged in master, so is not related to this patch. |
Yup, I was trying to upgrade a dependency but it failed the build, will revert the change. Ran e2e tests: https://github.com/serverless-nextjs/serverless-next.js/actions/runs/1070362351 |
Handler Size Report
Base Handler Sizes (kB) (commit bcc9f73){
"Lambda@Edge": {
"Default Lambda": {
"Standard": 1226,
"Minified": 432
},
"API Lambda": {
"Standard": 86,
"Minified": 34
},
"Image Lambda": {
"Standard": 894,
"Minified": 354
},
"Regeneration Lambda": {
"Standard": 620,
"Minified": 220
}
}
} New Handler Sizes (kB) (commit b3c656c){
"Lambda@Edge": {
"Default Lambda": {
"Standard": 1226,
"Minified": 432
},
"API Lambda": {
"Standard": 86,
"Minified": 34
},
"Image Lambda": {
"Standard": 894,
"Minified": 354
},
"Regeneration Lambda": {
"Standard": 620,
"Minified": 220
}
}
} |
Codecov Report
@@ Coverage Diff @@
## master #1448 +/- ##
==========================================
+ Coverage 84.14% 84.15% +0.01%
==========================================
Files 96 96
Lines 3367 3371 +4
Branches 995 996 +1
==========================================
+ Hits 2833 2837 +4
Misses 474 474
Partials 60 60
Continue to review full report at Codecov.
|
I see the e2e runs generated some errors, but I don't think those errors are related to the code, more to the service being used for that test. |
Yea, it's because it was hitting the homepage of https://jsonplaceholder.typicode.com/ for some tests and doing some comparison for rewrites, but because it's HTML and they recently added Cloudflare browser insights, there is some UUID generated that differs on each page load. Fixed it in another PR. |
Ah, that does explain a lot then, yeah 🙂 |
This mostly mimics serverless-components/aws-cloudfront#20 , but then converted to ts.
This adds the 'headers' option for origins, which allows one to set custom headers to be set with these origin requests.