-
Notifications
You must be signed in to change notification settings - Fork 80
Conversation
// 307 handling. | ||
// replay the previous request using the new url in the Location header | ||
// Ref : https://code.google.com/p/go/issues/detail?id=7912 | ||
if strings.HasPrefix(resp.Status, "307 ") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the resp.StatusCode
variable instead and compare against the http package constant?
if resp.StatusCode == http.StatusTemporaryRedirect {
}
Can you point me to the documentation that says that redirects need to be supported for PUTs and POSTs? The only place I see a mention of a redirect is when streaming data which uses a GET to open the SSE connection. |
I was just cleaning up my personal forks and saw this. Might be worth referencing:#32 |
Ref : https://www.firebase.com/docs/rest/api/#section-streaming |
I understand that because of golang/go#7912 Can you provide an example where the library is breaking because it's not following the redirects? |
golang/go#7912 is this issue fixed? not sure if fix discussed here made it to master branch?? |
@pdakhane This change has not made it to the master branch yet. The reason for this is because redirects are only needed for the HTTP Streaming api. Since the HTTP Streaming API dials to firebase using a I still cannot find any documentation that mentions the need to support redirects for the realtime database REST api. I'm going to close this PR until the need for redirect support comes back. |
@zabawaba99 Thank you, could you please point me to library/package where redirects are already respected?? |
@pdakhane The stdlib |
According to https://www.firebase.com/docs/rest/api/ we need client to handle redirect support.
Due to golang/go#7912 : the redirect is not supported for PUT and POST