-
Notifications
You must be signed in to change notification settings - Fork 44
$return http binding returns body buffers as JSON #252
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
Comments
cc @mhoeger Moving this issue to nodejs worker. ' |
@pragnagopa is there an GitHub issue you can share for that? |
@dhensby - this is is the issue tracking the fix |
This is the root cause - #228 Unfortunately, a known bug, saving for v3 for the breaking fix :\ |
closing as dup of #228 |
I am trying to serve an image from a function app running on node. At the moment we are doing this successfully using the
context.res
binding, however we are migrating our function apps to use the$return
output name/binding (as is the recommendation in the docs for functions with a single output).However, there seems to be inconsistent behaviour with named output bindings and the
$return
output binding. It appears that theisRaw
flag is being ignored or not acted on in the same way when using the$return
binding compared to a named binding.Investigative information
Please provide the following:
Repro steps
Create a function like so:
function.json:
index.js:
Expected behavior
The response should be sent to the browser without being mangled (the
isRaw
flag is set to true) and the Buffer should be output as binaryActual behavior
The response is a json-encoded Buffer and sent to the browser (with
; charset=utf-8
appended to the content type)Known workarounds
Use a named output binding:
function.json:
index.js:
Related information
This is a duplicate of Azure/azure-functions-host#3892 but hopefully provides some greater detail
The text was updated successfully, but these errors were encountered: