Azure / azure-functions-nodejs-worker

The Node.js worker for the Azure Functions runtime - https://functions.azure.com
MIT License
107 stars 44 forks source link

HTTP2 issue with node.js v4 programming model #754

Closed jcheritat closed 4 months ago

jcheritat commented 4 months ago

I created a node.js function with a HttpTrigger and the v4 programming model using azure func init / func new on windows 10.

When I start the function with the options --useHttps --cert and --password the function is exposed on https://localhost:7071

If I query it using Invoke-WebRequest or Invoke-WebMethod it works fine.

If I query it using Internet Explorer I get the following error :

System.Private.CoreLib: Exception while executing function: Functions.echo. System.Private.CoreLib: Result: Failure
Exception: Headers.append: ":method" is an invalid header name.
Stack: TypeError: Headers.append: ":method" is an invalid header name.
    at webidl.errors.exception (D:\repro\node_modules\@azure\functions\node_modules\undici\lib\fetch\webidl.js:13:10)
    at webidl.errors.invalidArgument (D:\repro\node_modules\@azure\functions\node_modules\undici\lib\fetch\webidl.js:29:24)
    at appendHeader (D:\repro\node_modules\@azure\functions\node_modules\undici\lib\fetch\headers.js:89:25)       
    at fill (D:\repro\node_modules\@azure\functions\node_modules\undici\lib\fetch\headers.js:68:7)
    at new Request (D:\repro\node_modules\@azure\functions\node_modules\undici\lib\fetch\request.js:441:9)        
    at new HttpRequest (D:\repro\node_modules\@azure\functions\dist\azure-functions.js:1694:20)
    at fromRpcTypedData (D:\repro\node_modules\@azure\functions\dist\azure-functions.js:717:16)
    at InvocationModel.<anonymous> (D:\repro\node_modules\@azure\functions\dist\azure-functions.js:196:73)        
    at Generator.next (<anonymous>)
    at D:\repro\node_modules\@azure\functions\dist\azure-functions.js:121:71.

From what I understand it's due to undici refusing the HTTP2 specific header :method

I didn't find a way to circumvent the problem. Any help would be welcome.

I also posted the issue here : https://github.com/Azure/azure-functions-core-tools/issues/3735

ejizba commented 4 months ago

Closing as duplicate of https://github.com/Azure/azure-functions-nodejs-library/issues/235. AFAIK right now the only workaround is to downgrade undici