mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
Don't read body into memory
This commit is contained in:
@@ -282,7 +282,7 @@ class MockTrans:
|
||||
self.security = self.app.security
|
||||
self.history = history
|
||||
|
||||
self.request: Any = Bunch(headers={}, body=None)
|
||||
self.request: Any = Bunch(headers={}, is_body_readable=False)
|
||||
self.response: Any = Bunch(headers={}, set_content_type=lambda i: None)
|
||||
|
||||
def check_csrf_token(self, payload):
|
||||
|
||||
@@ -158,7 +158,7 @@ def legacy_expose_api(func, to_json=True, user_required=True):
|
||||
if user_required and trans.anonymous:
|
||||
error_message = "API Authentication Required for this request"
|
||||
return error
|
||||
if trans.request.body:
|
||||
if trans.request.is_body_readable:
|
||||
try:
|
||||
kwargs["payload"] = __extract_payload_from_request(trans, func, kwargs)
|
||||
except ValueError:
|
||||
@@ -296,7 +296,7 @@ def expose_api(func, to_json=True, user_required=True, user_or_session_required=
|
||||
err_msg="API authentication or Galaxy session required for this request",
|
||||
)
|
||||
|
||||
if trans.request.body:
|
||||
if trans.request.is_body_readable:
|
||||
try:
|
||||
kwargs["payload"] = __extract_payload_from_request(trans, func, kwargs)
|
||||
except ValueError:
|
||||
|
||||
Reference in New Issue
Block a user