where certificate has been generated per these instructions for Azure functions, using PowerShell (see this and when you try that method, the resulting error message will provide the following commands):
Call the function from PostMan - works fine (PostMan does not add problematic headers). Call the function using a browser (Chrome, Edge, or FireFox) - and you will see the exception:
One or more errors occurred. (The header name format is invalid.)
[2021-06-10T12:50:23.837Z] ---> System.FormatException: The header name format is invalid.
[2021-06-10T12:50:23.838Z] at System.Net.Http.Headers.HttpHeaders.GetHeaderDescriptor(String name)
[2021-06-10T12:50:23.841Z] at System.Net.Http.Headers.HttpHeaders.Add(String name, String value)
Create a simple function "func init, func new" add an HttpTrigger and in the function code try accessing some header:
Now run the function with HTTPS using:
where certificate has been generated per these instructions for Azure functions, using PowerShell (see this and when you try that method, the resulting error message will provide the following commands):
Call the function from PostMan - works fine (PostMan does not add problematic headers). Call the function using a browser (Chrome, Edge, or FireFox) - and you will see the exception:
One or more errors occurred. (The header name format is invalid.) [2021-06-10T12:50:23.837Z] ---> System.FormatException: The header name format is invalid. [2021-06-10T12:50:23.838Z] at System.Net.Http.Headers.HttpHeaders.GetHeaderDescriptor(String name) [2021-06-10T12:50:23.841Z] at System.Net.Http.Headers.HttpHeaders.Add(String name, String value)
All 3 browsers tried above add a header ":authority:" when sending a HTTPS request. This is problematic for https://github.com/Azure/azure-functions-dotnet-worker/blob/72b9d17a485eda1e6e3626a9472948be1152ab7d/src/DotNetWorker.Core/Http/HttpHeadersCollection.cs#L39-L45
Related: issue. Even though the cause and symptom are different for that issue, I believe the fix will be the same.