Azure Functions - empty request body and missing headers with custom handler

Jon Seager 96 Reputation points
2020-08-03T09:01:33.213+00:00

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.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,605 questions
{count} votes

0 additional answers

Sort by: Most helpful