From 2de76c62dbb9d8bcc00aa45149463042b1b5ecdf Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Fri, 9 Nov 2018 23:23:42 -0800 Subject: [PATCH] Fix response header value with colon --- javascript/net/grpc/web/grpcwebclientreadablestream.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/net/grpc/web/grpcwebclientreadablestream.js b/javascript/net/grpc/web/grpcwebclientreadablestream.js index 98fb2032..a4149a7f 100644 --- a/javascript/net/grpc/web/grpcwebclientreadablestream.js +++ b/javascript/net/grpc/web/grpcwebclientreadablestream.js @@ -195,10 +195,10 @@ const GrpcWebClientReadableStream = function(genericTransportInterface) { } var responseHeaders = self.xhr_.getResponseHeaders(); if (GRPC_STATUS in responseHeaders && - responseHeaders[GRPC_STATUS] != StatusCode.OK) { + Number(self.xhr_.getResponseHeader(GRPC_STATUS)) != StatusCode.OK) { self.onErrorCallback_({ - code: Number(responseHeaders[GRPC_STATUS]), - message: responseHeaders[GRPC_STATUS_MESSAGE] + code: Number(self.xhr_.getResponseHeader(GRPC_STATUS)), + message: self.xhr_.getResponseHeader(GRPC_STATUS_MESSAGE) }); } });