zhoujiexiong commented on issue #11402:
URL: https://github.com/apache/apisix/issues/11402#issuecomment-2267561317

   I think you would expect `NotFound` instead of `Unimplemented` for the case 
of `grpc endpoint`.
   And we could add some more to response trailers according to H2/gRPC spec 
via LUA. 
   
   Attach my test output FYR:
   
   ## with response trailers => NotFound(Excepted)
   
   ```
   $ grpcurl -vv -plaintext -import-path proto  -proto helloworld.proto  -d 
'{"name":"apisix"}' 127.0.0.1:9081 helloworld.Greeter.GetErrResp
   
   Resolved method descriptor:
   rpc GetErrResp ( .helloworld.HelloRequest ) returns ( .helloworld.HelloReply 
);
   
   Request metadata to send:
   (empty)
   
   Response headers received:
   (empty)
   
   Response trailers received:
   content-length: 0
   content-type: application/grpc
   date: Sun, 04 Aug 2024 13:48:04 GMT
   grpc-status-details-bin: 
CAUSCU5vdCBGb3VuZBpXCip0eXBlLmdvb2dsZWFwaXMuY29tL2hlbGxvd29ybGQuRXJyb3JEZXRhaWwSKQgBEhxUaGUgc2VydmVyIGlzIG91dCBvZiBzZXJ2aWNlGgdzZXJ2aWNl
   server: APISIX/3.9.0
   Sent 1 request and received 0 responses
   ERROR:
     Code: NotFound
     Message: Not Found
     Details:
     1) {
          "@type": "type.googleapis.com/helloworld.ErrorDetail",
          "code": "1",
          "message": "The server is out of service",
          "type": "service"
        }
   ```
   
   ## without response trailers => Unimplemented(CURRENT)
   
   ```
   $ grpcurl -vv -plaintext -import-path proto  -proto helloworld.proto  -d 
'{"name":"apisix"}' 127.0.0.1:9081 helloworld.Greeter.GetErrResp
   
   Resolved method descriptor:
   rpc GetErrResp ( .helloworld.HelloRequest ) returns ( .helloworld.HelloReply 
);
   
   Request metadata to send:
   (empty)
   
   Response headers received:
   (empty)
   
   Response trailers received:
   (empty)
   Sent 1 request and received 0 responses
   ERROR:
     Code: Unimplemented
     Message: unexpected HTTP status code received from server: 404 (Not 
Found); transport: received unexpected content-type "text/plain; charset=utf-8"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to