-
Notifications
You must be signed in to change notification settings - Fork 19
Transfer-Encoding Chunked does not work in Javascript functions #171
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
Running into the same issue now. Have you found a way to parse the payload on the Azure Functions without updating the client code? |
I couldn't find a way when I last looked at this, and our workaround is sufficient for our needs. |
Hi @LwsSt , Let us know if you looking for a solution here, we shall transfer the issue to the appropriate team |
Yes, I believe this is a bug. I'd rather not have to include the workaround in my client code, and it looks like @Cellus250 is also running into the same issue. Expected behaviour: |
Moved this to the node.js repo - I think it was in Java on accident. Unfortunately this work is currently blocked by work in the host first. Related issues here: |
Moved to the library repo which is where we're tracking most of our work now. I'm hoping this will be fixed with #97, which we hope to make progress on soon |
Closing in favor of #97. I confirmed the stream work enables all transfer-encoding chunked requests. Please see that issue for updates on testing/timeline |
An HTTP request sent using Transfer-Encoding: Chunked to an Azure Function written in Javascript causes the body to be
undefined
.I discovered this issue when a C# client was communicating with a javascript azure function.
I refactored the client to change from StringContent to ObjectContent, and therefore it would stream the request directly to the HTTP request stream, instead of creating an intermediate string.
When sending the request this way, the Content Length isn't known, and so chunked transfer encoding is used.
When experimenting, the issue occurs whenever the Content-Length is not known before the request is sent.
Minimum reproduction:
A javascript azure function:
A console client in C#
In this example, req.body (or req.rawBody) will be set as
undefined
in the javascript function.Removing the line
content.Headers.ContentLength
will setreq.body
to the expected value.This issue does not occur if the function is re-written in C#:
Our current workaround is to call
HttpContent.LoadIntoBufferAsync();
.The azure function we're calling is a mock for a real service, and the real service supports chunked encoding. So we're having to put in a check to see if the client is communicating with the mock. Obviously, we would rather not require this check.
The text was updated successfully, but these errors were encountered: