Azure / Azure/azure-functions-host
`rawBody` http property should not be a UTF-8 string for byte data
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
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](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script/Rpc/MessageExtensions/RpcMessageConversionExtensions.cs#L169)).
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
Contributor guide
Research direction
Start in src/WebJobs.Script/Rpc/MessageExtensions/RpcMessageConversionExtensions.cs around line 169, where rawBody conversion is linked. Trace how byte-encoded HTTP bodies reach language workers and determine the intended rawBody representation. Done means rawBody consistently preserves the rawest body form instead of converting byte data to UTF-8 text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100