-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Include x-request-id as header response #95
Include x-request-id as header response #95
Conversation
Hey this is in draft because I want to make sure that I'm on the right path I'd be happy to get some help from you! |
assert.deepEqual(body, { | ||
enabled: true, | ||
get: true, | ||
getOrFail: true, | ||
}) | ||
|
||
assert.exists(headers['x-request-id']) |
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.
this was just a quick check, I'll write a new test for the feature
Hi, I also started to work on it but stopped as I saw your PR. As for testing, I would replicate in |
* | ||
*/ | ||
if (this.#config.generateRequestId) { | ||
this.header('X-Request-Id', this.request.headers['x-request-id']) |
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.
I think the X-Request-Id
should be set if its available in the request headers, regardless of whether it is enabled within the AdonisJS app or not.
This is because, the frontend might set the header, the backend app never generates it and re-uses the existing header and in that case, we still want the id to exist in the response.
Hey mate you can take over the PR as I won't have much time to finish it! |
Closed by #96 |
π Linked issue
#93
β Type of change
π Description
This includes x-request-id in the response headers
Resolves #93
π Checklist