Change request id header default value to false#4194
Conversation
generated by running 'node build/build-validation.js' after change on 'build-validation.js'
Changes default from 'request-id' to `false`. Making it opt-in instead of opt-out. NOTE: when user sets requestIdHeader to `true` the behavior is the same as if it was set to `false` because `req.headers[true] || genReqId(req)` is equivalent to `genReqId(req)` (req.headers[true] is undefined). TL;DR requestIdHeader must be a string, else it will be 'ignored'. Solution: Provide a default value for requestIdHeader when `true` or throw.
jsumners
left a comment
There was a problem hiding this comment.
I don't understand what this gives us other than API churn.
|
Assuming #4194 gets accepted. I just feel like the default config should be locked down and you can 'open up' instead of you having to 'lock down'. BUT I understand that this might break more things than fix. I can live with the opt-out, just if you don't know about it you might get surprised. |
|
This could land in v5 whenever we would ship it (likely spring/summer 2023) |
…efault-value-to-false
|
I investigated this. I kind of agree. Currently fastify will check for the request-id header and take that. Imho it should be opt-out, as @philippviereck suggested. |
mcollina
left a comment
There was a problem hiding this comment.
lgtm, we should do this for v5
|
@mcollina it is targetting next branch ;) |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Builds on #4193
This is a breaking change.
I believe the requestIdHeader should be opt-in instead of opt-out.
NOTE: when user sets requestIdHeader to
truethe behaviour is the same as if it was set tofalsebecause
req.headers[true] || genReqId(req)is equivalent to
genReqId(req)(req.headers[true] is undefined, therefore genReqId will be used).In other words
requestIdHeadermust be astring, else it will be 'ignored'.Solution: Provide a default value for requestIdHeader when
trueor maybe throw.Checklist
npm run testandnpm run benchmarkand the Code of conduct