X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0c65289a80fb376b9d7e53653e16cef6a8fa781e..2af20f8df88461f2593c7fa0851e3841f20d66c3:/nominatim/server/sanic/server.py diff --git a/nominatim/server/sanic/server.py b/nominatim/server/sanic/server.py index 0bc7a1e7..15887eef 100644 --- a/nominatim/server/sanic/server.py +++ b/nominatim/server/sanic/server.py @@ -35,12 +35,13 @@ 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) + return exception - def create_response(self, status: int, output: str, - content_type: str) -> HTTPResponse: - return TextResponse(output, status=status, content_type=content_type) + + def create_response(self, status: int, output: str) -> HTTPResponse: + return TextResponse(output, status=status, content_type=self.content_type) def config(self) -> Configuration: