add server glue for reverse API call

This commit is contained in:
Sarah Hoffmann
2023-03-25 17:04:02 +01:00
parent 35b52c4656
commit 300921a93e
4 changed files with 143 additions and 17 deletions

View File

@@ -35,7 +35,10 @@ class ParamWrapper(api_impl.ASGIAdaptor):
def error(self, msg: str, status: int = 400) -> SanicException:
return SanicException(msg, status_code=status)
exception = SanicException(msg, status_code=status)
exception.headers = {'content-type': self.content_type}
return exception
def create_response(self, status: int, output: str) -> HTTPResponse: