-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
Avoid timeout caused by Request with large body #768
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes:
- Attempting
json.loads
on all requests is going to be computationally heavy (though the code has been doing it for a while) request.html
both have existence checks forcurl
andclient
so they should be fine if thisif
condition is not executed. It would be nice to have tests for both cases (<20000 and >20000) to prevent regression.- This is a semi backwards incompatible change in that some users' requests will stop showing curl and client requests. It would be more elegant for some explanatory text to appear rather than simply the sections in the html output just disappearing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes pending passing tests
Hello @albertyw can you give some suggestions please ? Loic, |
silk/views/request_detail.py
Outdated
'request': request | ||
} | ||
|
||
if len(silk_request.raw_body < 20000): # Don't do this for large request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(silk_request.raw_body < 20000): # Don't do this for large request | |
if len(silk_request.raw_body) < 20000: # Don't do this for large request |
Oups, my bad. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #768 +/- ##
==========================================
+ Coverage 87.10% 87.26% +0.15%
==========================================
Files 52 52
Lines 2141 2144 +3
==========================================
+ Hits 1865 1871 +6
+ Misses 276 273 -3 ☔ View full report in Codecov by Sentry. |
I am frequently facing timeout because of request with very large body,
These are caused by body processing in request details to generate curl and client commands that are not so essential in most cases (in particular when working with large request)