-
Notifications
You must be signed in to change notification settings - Fork 45
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
HTTP output through context.done(null, res) and $return is not handled correctly #228
Labels
Milestone
Comments
wbreza
added a commit
to serverless/serverless-azure-functions
that referenced
this issue
Sep 5, 2019
This updates the default value for the name of the HTTP output binding from $return to $res to work around an issue that existing within the Azure core tools http runtime.. A bug exists in the Azure core tools http runtime that evaluates $return binding incorrectly which causes serialization issues when returning arrays within an HTTP response. Azure/azure-functions-nodejs-worker#228
tbarlow12
pushed a commit
to serverless/serverless-azure-functions
that referenced
this issue
Sep 13, 2019
This updates the default value for the name of the HTTP output binding from $return to $res to work around an issue that existing within the Azure core tools http runtime.. A bug exists in the Azure core tools http runtime that evaluates $return binding incorrectly which causes serialization issues when returning arrays within an HTTP response. Azure/azure-functions-nodejs-worker#228
mhoeger
added a commit
to mhoeger/azure-functions-nodejs-worker
that referenced
this issue
Nov 19, 2019
This was referenced Nov 19, 2019
Merged
Closed
What version of functions is this fix available in? |
Functions V3 (https://github.com/Azure/azure-functions-host/releases/tag/3.0.12915). This is still a preview version of Functions, but we're targeting to get it out of preview by end of year! |
thanks |
mhoeger
added a commit
to mhoeger/azure-functions-nodejs-worker
that referenced
this issue
Jan 14, 2020
mhoeger
added a commit
that referenced
this issue
Jan 15, 2020
mhoeger
changed the title
HTTP output through context.done(null, res) is not handled correctly
HTTP output through context.done(null, res) and $return is not handled correctly
Feb 21, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Setting HTTP output through context.done(null, res) and http output is not handled correctly.
Example:
Will return
System.Collections.Generic.List`1[System.Object]
as the body and not properly set the HTTP cookie.We can't change this yet because the bugfix is a breaking change. Currently, this behavior is supported (which would break with the bugfix):
Today, this returns a 200 with the HTTP body
[ "my", "array", "of", "results" ]
when http output binding is named$return
The code fix: In WorkerChannel.ts => invocationRequest => resultCallback => if (result.return), we need to check if it is an HTTP type and not just a generic "TypedData"
The mitigation: do not use context.done(err?, results?) to output results for HTTP output binding.
The text was updated successfully, but these errors were encountered: