-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
lib/components/grpc.ts
Outdated
} else if (Array.isArray(options.proxyDebugHeaders)) { | ||
for (const headerName of options.proxyDebugHeaders) { | ||
if (headers[headerName] !== undefined) { | ||
debugHeaders[`x-${headerName}`] = headers[headerName]; |
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 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
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've decided to use x-gateway
prefix
lib/components/grpc.ts
Outdated
if (headers['uber-trace-id']) { | ||
debugHeaders['x-uber-trace-id'] = headers['uber-trace-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 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
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.
Ok, I agree with you
Add ability to customize debugHeaders via option
proxyDebugHeaders
.Close #50