This is now resolved: https://github.com/Azure/azure-functions-host/issues/6444
Azure Functions - empty request body and missing headers with custom handler
Hi all,
I've got an Azure Function which uses a custom handler written in Go. It was all working fine until Friday and now the requests appear to be turning up with empty request bodies and missing headers? Has anyone else experienced this?
The Go handler is really simple...
func main() {
httpInvokerPort, exists := os.LookupEnv("FUNCTIONS_HTTPWORKER_PORT")
if exists {
log.Printf("FUNCTIONS_HTTPWORKER_PORT: %s\n", httpInvokerPort)
}
mux := http.NewServeMux()
mux.HandleFunc("/sign", httpTriggerHandler)
log.Println("Go server Listening...on httpInvokerPort:", httpInvokerPort)
log.Fatal(http.ListenAndServe(":"+httpInvokerPort, mux))
}
And the handler function:
func httpTriggerHandler(w http.ResponseWriter, r *http.Request) {
spew.Dump(r)
// other app logic
}
Since late last week, the spew shows an empty request body (where there should be JSON), and a few missing headers. I've not changed anything in the code, and can't see any major changes to the Azure Functions service.
I've done some troubleshooting, including MITM'ing myself outbound to ensure that the request is leaving my machine well-formed and it all seems fine. I've also tried redeploying to other Azure regions.