You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently calling a grpc server which doesn't handle the grpc-message correctly, so sometimes it will send unencoded grpc-message containing %, causing the decodeURI (code) to throw the following exception.
details = decodeURI(metadataMap['grpc-message']);
^
URIError: URI malformed
at decodeURI (<anonymous>)
at Http2CallStream.handleTrailers (.../node_modules/@grpc/grpc-js/build/src/call-stream.js:322:23)
at ClientHttp2Stream.<anonymous> (.../node_modules/@grpc/grpc-js/build/src/call-stream.js:378:26)
at ClientHttp2Stream.emit (node:events:520:28)
at ClientHttp2Stream.emit (node:domain:475:12)
Reproduction steps
decodeURI('%') <---- throws a unhandled exception, then crashes the server
Additional context
There are 2 ways to handle the exception:
catch the exception and use endCall to return an error (similar code) . or
When decoding invalid values, implementations MUST NOT error or throw away the message. At worst, the implementation can abort decoding the status message altogether such that the user would received the raw percent-encoded form. Alternatively, the implementation can decode valid portions while leaving broken %-encodings as-is or replacing them with a replacement character (e.g., '?' or the Unicode replacement character).
The text was updated successfully, but these errors were encountered:
Problem description
We are currently calling a grpc server which doesn't handle the
grpc-message
correctly, so sometimes it will send unencodedgrpc-message
containing%
, causing thedecodeURI
(code) to throw the following exception.Reproduction steps
Additional context
There are 2 ways to handle the exception:
endCall
to return an error (similar code) . orgrpc-message
ifdecodeURI
failedThe gRPC HTTP/2 spec seems to prefer the second way:
The text was updated successfully, but these errors were encountered: