-
Notifications
You must be signed in to change notification settings - Fork 447
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
rawBody
http property should not be a UTF-8 string for byte data
#4475
Comments
I was running into this issue locally the other day in Node. Since the update docs issue is closed, I'm wondering if this behavior is still being looked at. I rewrote my code in another language to get around it. (Content-Type headers can fix it, but don't help in my situation). $ func
Azure Functions Core Tools (3.0.2245 Commit hash: 1d094e2f3ef79b9a478a1621ea7ec3f93ac1910d)
Function Runtime Version: 3.0.13139.0 I never tested it on Azure itself. |
This is a pretty significant breaking change and we didn't take it for v3.x. It's still a big consideration for future versions. What other language did you choose to do this? And if you need content-type to be added to all requests (say you don't necessarily have control over that), you can use functions proxies |
Can't work due to issue uploading binary files: Azure/azure-functions-host#4475 Without control over headers we only get the UTF-8 parsed version of the body which ruins our data.
@pragnagopa -- do you have context on this? Is it something we should/could take for v4? |
Ideally, the body that we pass to language workers should always be the
raw
form (ex: if the body is application/json, then it should be the string version and not the parse'd object). If the language worker wants to add a method on top of that to get a "pretty" object, that is ok, but it should be language-dependent and as an additional method (not the default behavior).One solution to passing only raw HTTP bodies is to use the
rawBody
property.However -
rawBody
is not always the true raw body. In cases where the body is encoded as bytes, rawBody is actually the UTF-8 string version of the body (code here).This issue tracks making
rawBody
consistent, with the ultimate goal of passing the "rawest" form of data possible.cc: @pragnagopa and @maiqbal11 to add any details
The text was updated successfully, but these errors were encountered: