-
Notifications
You must be signed in to change notification settings - Fork 457
Http request with header transfer-encoding set to chunked is not handled as expected #4926
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
This is basically blocking the proposed design and implementation for an important project. If this is not fixed, we will have to re-design and implement the planned integration. Can you please fix this as priority ASAP or please let us know ETA if you have it. |
Can we please get an update? Our project is in day by day slip without this resolved. |
cc: @fabiocav , @ColbyTresness |
@mhoeger as well |
We are still stuck and haven't heard anything regarding this issue. Can we please get a status update? |
I'm experiencing the same issue except that I'm running with Java locally. My environment: |
Having the same problem with a Node.js function - a POST with chunked encoding results in both |
@soninaren (and others on the thread), there was an update recently made to the HTTP binding that could potentially help with this, so we need to validate whether that is indeed the case. This is an opt-in behavior (as it does have security implications). In order to enable to feature, you need to update the binding configuration in host.json with the following: {
"extensions": {
"http": {
"EnableChunkedRequestBinding": true
}
}
} |
Triaging for assignment (for validation only) |
@soninaren could you also follow up with a documentation issue to make sure this is publicly documented (with the warnings). @alrod should be able to assist here as well. |
@fabiocav Can you detail more about what the security implications are? |
Hi!
@fabiocav Was this improvement only made to http binding for the v2 Function runtime or is this extensions configuration also available for v3 and v4? What about in-process vs. isolated? I'm unable to find any documentation on this config option. We' are currently blocked by this with a dotnet-isolated function running .NET 5 on runtime v3. See Azure/azure-functions-dotnet-worker#713 Thanks! David |
I just did a quick test with curl -ivsS --trace -H "Transfer-Encoding: chunked" --data 123 -X POST http://localhost:7071/api/fn and this setups
Observations:
Maybe I'm going out on a limb but I do consider the mishandling of chunked transfers in workers running out-of-process a bug - especially when none of it is documented anywhere. @fabiocav Do you agree with my analysis? Even if you don't concur with my conclusion, did I get the facts straight? Thanks! David |
Just to add more keywords here: This issue means that you cannot send requests to an HTTP Trigger on the function runtime using the HttpClient This is considered a "server side fix and issue". |
This is still an ongoing issue. Is there any progress to fix this issue? |
Same issue with Python - |
Unfortunately Azure Functions has a bug that doesn't allow it to work with chunked requests right now. Azure/azure-functions-host#4926 This flag made the "usage" output pretty ugly because it is so long, so I opted to leave it out (similar to "--serializer" which I'm not sure was an intentional ommission or not). Totally open to another way!
I feel like it's important to stress here again that this bug in combination with the fact that I really can't think of a use case for an HTTP Triggered Azure Function that I've seen more often than "post JSON to it from a C# application", so I'm confused why this issue has languished for three years. Now that we're five days away from developers not being able to migrate to .net 7 functions unless they also move to isolated functions, this seems especially urgent. @fabiocav am I missing something here? |
#Azure/azure-functions-dotnet-worker#374 Here is another issue where a number of developers wrestled with this issue and never got to the root cause, though they did find the workaround. |
@cloudmelon I was made aware that you might be able to help us with this issue. |
Thanks, @mrurb we'll take a look at this and get back to you. |
Hi @mrurb i checked with the team, and this is an opt-in behavior that's not enabled by default due to the security implications. In order to enable to feature, you need to update the binding configuration in host.json with the following: {
"extensions": {
"http": {
"EnableChunkedRequestBinding": true
}
}
} And this should be able to resolve your issue, let us know if that works and hopefully unblock your customers. I am tagging @fabiocav here for vis. |
Hi @cloudmelon as mentioned earlier in this thread, the configuration in the host.json seems to have no effect.
Just to make sure that anything has not changed since last tested, I just tested it and it still has no effect: |
@cloudmelon @fabiocav |
The current HTTP model for isolated doesn't all head chunking scenarios, but we're working on a new design that will help resolve related challenges here |
Confirmed that In addition to fixing the behavior, part of the work here is to ensure that this gets properly documented. |
@fabiocav @mattchenderson Is there a reason this was moved out of Sprint 147, but not into any other sprint? I was looking forward to this being addressed. |
We've changed our sprint process and are trying to shift milestones to deliverables rather than sprints. As part of this, we clsoed out a bunch of sprint-related milestones, so that's what you're seeing here. It's still a work in progress. This item is still on our radar, although I don't have a specific ETA attached to it quite yet. |
After looking through this issue, we've concluded that for dotnet-isolated that the currently used HTTP model doesn't support chunking, which is why the body content does not propagate. However a workaround for this issue for .NET isolated is to use the new ASP.NET core integration HTTP model (which is still in preview). Note the feature flag does not have to be set in the host when using this new HTTP model. As for the other language workers, we will continue working on adapting this new HTTP model. |
Disappointing from Microsoft! It does not support basic features! |
@aishwaryabh What's the ETA on finally getting streaming/chunking support in Node/JS? This lack of support makes large data transfers impossible as an input or output of Azure Functions. |
Sorry but is this related to this issue? |
@hholst80 Thanks so much, that saves my life |
Is chunked transfer encoding still not supported? |
This still seems to be an issue. Is there a fix planned for those using .NET 8 isolated worker model with C#? |
As far as I can see we should be using For middleware, buffering the body stream is a little tricky since the Common middleware probably needs to try and differentiate between grpc request data, null stream, and aspnet request data. Transitioning is an all or nothing approach since you can only use the host builder with either The problem for us was compounded with Azure API started applying chunked transfer encoding to requests without it, and without and configuration to disable or control that behaviour, and no way to implement a policy to prevent it. This does not give the perception of competence or value to customers when poor design and implementation hinders progress frequently. |
I just got bit by this. Is the solution really switching to asp.net bindings? This is a huge problem for me. We just upgraded 14 function apps to .net8 isolated and all have HttpTrigger endpoints. I have no control over consumer's transfer-encoding's! |
I was able to work-around this issue as follows...
|
Uh oh!
There was an error while loading. Please reload this page.
Function runtime: v2
Environment: Core-tools and Azure
Repro steps:
It works as expected for C# and csx functions apps. but for node the function runtime processes the request without the request body which results in a 400 Bad request.
The text was updated successfully, but these errors were encountered: