mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Merge pull request #255 from YunoHost/raw_http_responses
Allow python functions to return a raw HTTPResponse
This commit is contained in:
commit
6b99f8b77d
1 changed files with 3 additions and 0 deletions
|
@ -577,6 +577,9 @@ def format_for_response(content):
|
||||||
return ""
|
return ""
|
||||||
response.status = 200
|
response.status = 200
|
||||||
|
|
||||||
|
if isinstance(content, HTTPResponse):
|
||||||
|
return content
|
||||||
|
|
||||||
# Return JSON-style response
|
# Return JSON-style response
|
||||||
response.content_type = "application/json"
|
response.content_type = "application/json"
|
||||||
return json_encode(content, cls=JSONExtendedEncoder)
|
return json_encode(content, cls=JSONExtendedEncoder)
|
||||||
|
|
Loading…
Add table
Reference in a new issue