Skip to content

grpc-js: Implement server interceptors#2650

Merged
murgatroid99 merged 2 commits intogrpc:masterfrom
murgatroid99:grpc-js_server_interceptors
Feb 1, 2024
Merged

grpc-js: Implement server interceptors#2650
murgatroid99 merged 2 commits intogrpc:masterfrom
murgatroid99:grpc-js_server_interceptors

Conversation

@murgatroid99
Copy link
Member

This is an implementation of gRFC L112, currently in review at grpc/proposal#406. I had to rewrite a lot of the server-side request handling code to accommodate the new API, and I think the result is an improvement.

I changed a couple of existing tests because the previous behavior was incorrect:

  • A test previously asserted that when a server sends an error, channelz counts it as a failed stream in the socket data. However, a stream should be counted as successful if the server explicitly ended it with trailers.
  • Previously, the server sent an OUT_OF_RANGE status when receiving an invalid grpc-timeout value, but the library is not allowed to generate that status, so I changed it to INTERNAL.

The new test file shows a few over-simplified examples of using the server interceptor API.

This fixes #419.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add server interceptors

2 participants