This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
redirect not working? #8
Comments
lion3ls
added a commit
that referenced
this issue
Aug 25, 2017
The default Go http client used in the lib follows redirects by default. The consequences being any redirect returned by the end user Lambda is first fully resolved by Go before returned to API Gateway. This patch resolves the issue by disabling this default behaviour. CAT: #fix REF: #8 THX: @Zambiorix
@Zambiorix update your package, everything should work as expected now 😉 |
:-) great, I'll test it immediately! Another thing, I believe there is a still a bug in the code: You should always close a response body if a response is present.
|
It's working :-) I use redirects to test if cookies are allowed by client, and it now works as expected Thanks! |
I would solve the response body closure like this
|
lion3ls
added a commit
that referenced
this issue
Aug 25, 2017
Value returned by http client Do function is nil or already closed if there is any error. See https://golang.org/src/net/http/client.go?s=16518:16570#L480 Therefore in order to avoid memory leaks in a potential ioutil.ReadAll error and to be Go idioms compliant, the response body is deferred to be closed immediately after checking there is no error with the Do function. CAT: #fix REF: #8 THX: @Zambiorix
@Zambiorix you're right in the fact that the body should be deferred closed before |
great, thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Am I correct that aws-lambda-go-net is not passing on a redirect properly to the client?
I think it gets stuck in this component and doing a redirect locally ...
Cheers
Gerd
The text was updated successfully, but these errors were encountered: