You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a http wrapper for the MyFitnessPal API. When I'm trying to get a callback code which is located in the header, I'll get an error message. To reproduce clone the following repository and install the dependencies and then run:
gorunmain.go
What did you expect to see?
A response with status code 302 and a location header which contains the callback code.
If the http client follows the redirect, it will see mfp://identify/.... which is invalid to the http client. I think you want to configure CheckRedirect of the http client to prevent it from following the redirect and handle the header yourself. See https://pkg.go.dev/net/http@go1.19.1#Client for documentation about CheckRedirect.
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote a http wrapper for the MyFitnessPal API. When I'm trying to get a callback code which is located in the header, I'll get an error message. To reproduce clone the following repository and install the dependencies and then run:
What did you expect to see?
A response with status code 302 and a location header which contains the callback code.
What did you see instead?
I'll get the following error message:
response variable is nil.
I know that this "mfp://" url is in headers, because I checked it with a proxy before (see screenshot below)
It looks like net/http is validating header values, which, if I understood it right, should'nt do it
The text was updated successfully, but these errors were encountered: