Skip to content
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: add ability to customize debugHeaders via option proxyDebugHeaders #52

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

SeqviriouM
Copy link
Contributor

@SeqviriouM SeqviriouM commented Apr 17, 2024

Add ability to customize debugHeaders via option proxyDebugHeaders.

Close #50

@SeqviriouM SeqviriouM self-assigned this Apr 17, 2024
} else if (Array.isArray(options.proxyDebugHeaders)) {
for (const headerName of options.proxyDebugHeaders) {
if (headers[headerName] !== undefined) {
debugHeaders[`x-${headerName}`] = headers[headerName];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not best idea to add x- prefix in itself because it can lead to headers like x-x-request-id, x-x-forwarded-for and others, which is not entirely clear. I suggest to use at least x-header- prefix to separate them from default debug headers. But generally it's not a big deal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to use x-gateway prefix

Comment on lines 779 to 781
if (headers['uber-trace-id']) {
debugHeaders['x-uber-trace-id'] = headers['uber-trace-id'];
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't need to do this because this is specific header (uber-trace-id is Jaeger naming as I know) which is used in the @gravity-ui/nodekit only and not related to @gravity-ui/gateway itself. @gravity-ui/gateway can be used without @gravity-ui/nodekit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I agree with you

@SeqviriouM SeqviriouM merged commit d68411e into main Apr 17, 2024
5 checks passed
@SeqviriouM SeqviriouM deleted the seqvirioum/proxy-debug-headers branch April 17, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuring keys for debugHeaders
2 participants