Skip to content
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

Can't pass through large responses #881

Closed
mayrand opened this issue May 9, 2019 · 4 comments
Closed

Can't pass through large responses #881

mayrand opened this issue May 9, 2019 · 4 comments

Comments

@mayrand
Copy link

mayrand commented May 9, 2019

Expected Behavior / New Feature

Implement option to pass through response without loading it to memory to be able to work with large responses.

Actual Behavior / Motivation for New Feature

Response limit is 2GB.

My quick solution

src/Ocelot/Requester/HttpClientWrapper.cs
@@ -17,7 +17,7 @@ namespace Ocelot.Requester
 
         public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request)
         {
-            return Client.SendAsync(request);
+            return Client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
         }
     }
 }

@ztzsws1
Copy link

ztzsws1 commented Jun 17, 2019

image
I have same issue, can not download file which larger that 2G.
If I change ocelot code like @mayrand , it works fine. I am not sure if this will cause other problems.
Is there any suggestion?
@TomPallister

@ztzsws1
Copy link

ztzsws1 commented Jun 17, 2019

Can we support to config which route use the option ResponseHeadersRead, and which one used option Default?
Maybe like this,
{ "DownstreamPathTemplate": "/api/{everything}", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 12345 } ], "UpstreamPathTemplate": "/common/api/{everything}", "UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete" ], "HttpCompletionOption":"ResponseHeadersRead" --------------> Here },

@raman-m
Copy link
Member

raman-m commented Jan 20, 2024

Hi @mayrand and @ztzsws1 !
Downloads & uploads of large files should be fixed in the current upcoming release, right @ggnaegi ?
Please watch for next version 23.0 and the release milestone will be closed soon...

@raman-m
Copy link
Member

raman-m commented Jan 20, 2024

Fixed by #1724 and #1824

@raman-m raman-m closed this as completed Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants