-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers cased incorrectly #274
Comments
Hi @harshithkashyap, the reason why we don't pass this information is because of a serializing issue that we discovered with using proto3. Here's the original issue: #142 And this is the fix needed: Azure/azure-functions-language-worker-protobuf#21 While this is unavailable, our recommended workaround is to access header data through
|
@mhoeger I can now see the header under |
Adding to this issue - in bindingData, it's "x-CUSTOM-HEADER". In req.headers, it's 'x-custom-header', and what we expect is "X-CUSTOM-HEADER" |
Any ETA to fix this? |
@vicancy - Don't have a good ETA on this item. Either we patch headers to have both combinations of casing (which is a bit strange but not a breaking change) or we fix the first letter to not become lower cased (which is a breaking change for people who are relying on that). One thing that may be helpful is that the request object by default has a "get" method that takes a header name and gets the property, regardless of casing. I think using |
TBH, fixing the |
@vicancy - sorry what do you mean? HTTP headers are expected to be case insensitive. The reason why it's case sensitive is because we expose headers as a properties of a JavaScript object (in addition to exposing it through the If we pushed out a fix today to preserve a header's casing to the best of our ability, current users who are looking for something like "x-CUSTOM-HEADER" would immediately be broken. I know that the casing is unexpected but I don't know what you mean by "fixing the parser sounds the most important." What is your suggestion there? |
I mean the original issue: "Empty Headers are parsed incorrectly" in |
Update: "Empty Headers are parsed incorrectly" issue has been fixed but not headers cased incorrectly issue. |
Just to clarify: when writing a function that uses @mhoeger refers to |
I can confirm this is still happening because of this logic. I used this to test:
We should at least decide on best practice and make sure it's added to the TypeScript definitions. Longer term we should consider removing that extra camel case logic because it may be more trouble than it's worth. |
Main points: - We don't want `toCamelCase` to call `fromRpcTypedData` because it traverses an entire object recursively and only the top level objects should be RpcTypedData - We will remove triggerMetadata from http/timer triggers. That information is best found on the request/timer objects instead Related to all of these bugs: Azure/azure-functions-nodejs-worker#607 Azure/azure-functions-nodejs-worker#274 Azure/azure-functions-nodejs-worker#204 Azure/azure-functions-nodejs-worker#388
For the existing programming model, we recommend using For the new programming model, this was addressed in Azure/azure-functions-nodejs-library@efa5fb3. I've started a doc here with more information: https://aka.ms/AzFuncNodeV4 |
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
Expected behavior
Headers with empty values should be parsed as empty string.


The following screenshots shows the headers with empty values being correctly parsed by ngrok.
Actual behavior
Instead, the other subsequent headers are parsed for the empty header.

Known workarounds
There are no known workarounds as of now as it's difficult to predict the empty header without access to raw http request.
Related information
The text was updated successfully, but these errors were encountered: