gRPC-Web Developer Tools conflicts with unary interceptors introduced by grpc/grpc-web
See original GitHub issueI’v found that enabled gRPC-Web Developer Tools (by SafetyCulture) brokes up unary interceptors set up for grpc-web client. Interceptors are being not called when gRPC-Web Developer Tools are enabled.
Issue was found with next code:
const AuthInterceptor = function() {
this.intercept = function(request, invoker) {
request.getMetadata().Authorization = AuthService.GetAuthHeaderValue();
return invoker(request);
};
};
const options = {"unaryInterceptors": [new AuthInterceptor()]};
const APIClient = new APIPromiseClient(API_URL, null, options);
const enableDevTools = window.__GRPCWEB_DEVTOOLS__ || (() => {});
enableDevTools([
APIClient,
]);
APIClient.me(new ProtobufEmpty(), {})
.then(result => {
...
})
.catch(error => {
console.error(error); // <-- when gRPC-Web DevTools are enabled I receive error "no auth header" from my backend
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
Interceptors in gRPC-Web
Unary interceptor example · It prepends a string to the gRPC request message before the RPC. · It prepends a string to the...
Read more >grpc/grpc - Gitter
Anyone have experience with grpc-web (commonjs client), grpc-go (server), envoy proxy and server side streaming? I'm getting en error in the client after ......
Read more >Grpc cancelled - Caritas Castellaneta
Server streaming: This is similar to unary RPC, except that the server returns a stream of ... We will introduce gRPC as a...
Read more >Connect - Go Packages
Handlers and clients support three protocols: gRPC, gRPC-Web, ... Interceptor) Option; func WithOptions(options . ... It's used in unary interceptors.
Read more >Beginning gRPC with ASP.NET Core 6
Anthony Giretti is a senior lead software developer at OneOcean in Montreal, Canada. He is a technical leader and four-time Microsoft MVP ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this will fix it https://github.com/SafetyCulture/grpc-web-devtools/pull/79
@jrapoport, sorry for the delayed response. Unfortunately that won’t help us here. The IT org has chrome locked down so we can only install extensions from their whitelist, so even if you published it, I’d have to get it through the approval process, which is a bunch of red tape. I understand their concern, there is a fair bit of malware on the chrome extension store.