-
Notifications
You must be signed in to change notification settings - Fork 365
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
feat: use netlify-headers-parser
#3189
Conversation
📊 Benchmark resultsComparing with fa064f1 Package size: 330 MB(no change)
Legend
|
'/': { | ||
'X-Frame-Options': ['SAMEORIGIN'], | ||
test('_headers: validate rules', async (t) => { | ||
const rules = await parseHeaders({ headersFiles: [path.resolve(t.context.builder.directory, '_headers')] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseHeaders()
now returns an array instead of an object.
The source code and tests were updated to take it into account.
'X-Frame-Options': ['SAMEORIGIN'], | ||
'X-Frame-Thing': ['SAMEORIGIN'], | ||
'X-Frame-Options': 'SAMEORIGIN', | ||
'X-Frame-Thing': 'SAMEORIGIN', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple headers with the same name are now joined into a single one with ,
which is the production behavior.
The current netlify dev
behavior is to set several HTTP headers instead.
So this fixes a difference between production and local experience.
e37bae7
to
d62c747
Compare
Part of netlify/build#2890
This uses
netlify-headers-parser
inside Netlify CLI in order to:@netlify/config
andnetlify dev
netlify dev
(withnetlify-redirects-parser
)netlify-headers-parser
I have updated the automated tests and also tested it manually.