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

Fix response header value with colon #365

Merged
merged 1 commit into from
Nov 10, 2018

Conversation

stanley-cheung
Copy link
Collaborator

Fixes #318.

Very strange, let's say we have this response header grpc-message: Foo: Bar sent back from gRPC backend service, and thru Envoy, from the browser console, the header value apparently was sent back properly.

But, if I call xhr.getResponseHeaders() to get the whole bag of response headers, one of the key:value pair was grpc-message: Foo.

OTOH, if I call xhr.getResponseHeader('grpc-message'), I get Foo: Bar back properly.

I couldn't find a bug from Chrome or Closure to report this strange behavior with xhr.getResponseHeaders().

Also OTOH, I cannot find any HTTP spec that said that http header value cannot have a colon in it. So apparently it's OK to have header value that has a colon in it.

@@ -195,10 +195,10 @@ const GrpcWebClientReadableStream = function(genericTransportInterface) {
}
var responseHeaders = self.xhr_.getResponseHeaders();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why even use getResponseHeaders at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error message with colon does gets changed on the way to the client app
2 participants