azure-functions-host
azure-functions-host copied to clipboard
golang customHandler HTTP redirect not sent back to client
Using Function App in Azure to develop a REST API. We are using golang for the REST API server.
Our function app is using enableForwardingHttpRequest set to "true", so that there is no need to have Function App specific changes or handling to the REST API.
All was working well until we attempted to HTTP redirect (302) in the responses.
Instead of the 302 responses to be sent back to the client, got either 404 or 500 responses. Have no logs to confirm, but suspecting that the redirect was being handled by the Functions Host Http Handler that is receiving the 302 and attempting to redirect. And the originating HTTP client would get a 404 or 500 from the function app, depending on the Location that was being used in the response.
Looked into the Functions Host code in this repo and did not see any setting to false of AllowAutoRedirect property. Suspecting this might be the problem.
Opened this question in Microsoft QA forum related to Function Apps
https://docs.microsoft.com/en-us/answers/questions/369932/azure-function-golang-customhandler-http-redirect.html
and got feedback from Pramod Valavala (Community Expert), that it probably is a Functions Host issue, he agreed with my assessment that HttpClientHandler is the most cause as he noted that the AllowAutoRedirect was not specifically set to false and is having the default true value.
Pramod suggested a workaround to disable enableForwardingHttpRequest. I did not yet attempt the workaround, and I suspect that it will resolve the issue. Still I would rather not turn off the enableForwardingHttpRequest feature.
Hi @rocco-corsi-elits , Thank you for providing your findings, we will check this internally for any known issues and get back to you
Great. Thank you!
Triaging this issue as bug as it requires fix
Similar to #7860 with this PR in progress #8372
3 years has passed by, any updates?