Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning 302 redirect as response #607

Closed
ubenzer opened this issue Apr 18, 2018 · 4 comments
Closed

Returning 302 redirect as response #607

ubenzer opened this issue Apr 18, 2018 · 4 comments

Comments

@ubenzer
Copy link

ubenzer commented Apr 18, 2018

Hi,

I am looking for a way to return 302 redirects to another URL as a response from grpc-gateway. In my research, I couldn't find a way to do it. In fact, I somewhat assume that it is not possible due to this.

It would be really nice to provide this functionality.

Please see this SO question of mine, that explains the same thing in detail.

@tmc
Copy link
Collaborator

tmc commented Jun 19, 2018

I thought there was an issue around having exact control of the raw http response body but I'm not seeing it now. I agree this is a use case that should be straightforward.

@c4milo
Copy link

c4milo commented Oct 15, 2018

@ubenzer, you may be able to do that by using https://godoc.org/github.com/grpc-ecosystem/grpc-gateway/runtime#WithOutgoingHeaderMatcher. The question whether this is a good practice or not remains. Perhaps @tmc can help to shed some light since I'm dubious right now.

@mayank-dixit
Copy link

@ubenzer what did you end up doing? WithOutgoingHeaderMatcher worked or you ended up using some other approach?

@ubenzer
Copy link
Author

ubenzer commented Feb 7, 2019

I ended up implementing our logic on the client side. In one request I get the URL for the image and in the second request, we get the image itself by using the response of the first request.

This was implemented before I learned that such a thing WithOutgoingHeaderMatcher existed. I don't know if that would've been worked for me or not.

I'll close this issue as this is not required for me anymore.

@ubenzer ubenzer closed this as completed Feb 7, 2019
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

No branches or pull requests

4 participants