Skip to content
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

Open
mhoeger opened this issue May 20, 2019 · 3 comments
Open

rawBody http property should not be a UTF-8 string for byte data #4475

mhoeger opened this issue May 20, 2019 · 3 comments

Comments

@mhoeger
Copy link
Contributor

mhoeger commented May 20, 2019

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

@Lytigas
Copy link

Lytigas commented May 13, 2020

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.

@mhoeger
Copy link
Contributor Author

mhoeger commented May 13, 2020

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

Lytigas added a commit to Lytigas/azure-functions-keepassdav that referenced this issue May 13, 2020
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.
@brettsam
Copy link
Member

brettsam commented Jun 3, 2021

@pragnagopa -- do you have context on this? Is it something we should/could take for v4?

@fabiocav fabiocav removed this from the Triaged milestone Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants