grpc-ecosystem / grpc-gateway

gRPC to JSON proxy generator following the gRPC HTTP spec
https://grpc-ecosystem.github.io/grpc-gateway/
BSD 3-Clause "New" or "Revised" License
17.65k stars 2.18k forks source link

pass http request uri to grpc server #588

Open jinleileiking opened 6 years ago

jinleileiking commented 6 years ago

Please follow the general troubleshooting steps first:

Bug reports:

Fill in the following sections with explanations of what's gone wrong.

Steps you follow to reproduce the error:

  1. curl http://xxxx.com/adfa/ccc?eeee=5

What did you expect to happen instead:

my request is http://xxxx.com/adfa/ccc?eeee=5 I should use the string http://xxx.com/adfa/ccc?eeee=5 to do some checks by interceptor. But I cannot get the uri, I only have the http headers host etc. I need get uri From now, there is no way.

Suggest pass these headers:

url : http://xxxx.com/adfa/ccc?eeee=5
uri_full : xxxx.com/adfa/ccc?eeee=5
uri: xxxx.com/adfa/ccc
yugui commented 6 years ago

Could you explain a bit more about the background of the request?

jinleileiking commented 6 years ago

It is not so common.

There is no way to write a middleware in grpc-gateway middleware. so I need write in grpc-interceptor.

shivasishdas commented 3 years ago

@jinleileiking Were you able to solve this? Have come across a similar use case where I need to access the complete REST URI from the gRPC middleware.

johanbrandhorst commented 3 years ago

You can do it with normal HTTP middleware around the runtime.ServeMux.