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
functionvalidate(key: string,value?: MetadataValue): void{// ...if(isBinaryKey(key)){if(!Buffer.isBuffer(value)){thrownewError("keys that end with '-bin' must have Buffer values");}}// ...}
So grpc-js is forcing their users to use Buffer, and I don't think there is any problem with that.
I think adding a simple if-else may be the solution. I tried something like this and it works for me.
I want to mock gRPC response with a metadata which has '-bin' name suffix.
According to document gRPC over HTTP2, a header name ends with '-bin' indicates that it has binary value, and the value should be base64 encoded.
It seems that metadata is not treated properly in GrpcParser, and cause an error. (v0.14.2)
error: keys that end with '-bin' must have Buffer values
This error is comes from @grpc/grpc-js/src/metadata.ts
So grpc-js is forcing their users to use Buffer, and I don't think there is any problem with that.
I think adding a simple if-else may be the solution. I tried something like this and it works for me.
The text was updated successfully, but these errors were encountered: