diff --git a/g2p_registry_rest_api/http.py b/g2p_registry_rest_api/http.py index 31c0e3b0..463f73dc 100644 --- a/g2p_registry_rest_api/http.py +++ b/g2p_registry_rest_api/http.py @@ -1,6 +1,6 @@ import json -from werkzeug.exceptions import BadRequest, HTTPException, InternalServerError +from werkzeug.exceptions import BadRequest, InternalServerError import odoo from odoo.http import Root @@ -14,8 +14,6 @@ def g2pFixException(exception, original_exception=None): - get_original_headers = HTTPException(exception).get_headers - def get_body(environ=None, scope=None): if original_exception and isinstance(original_exception, G2PApiException): res = G2PErrorResponse( @@ -36,15 +34,6 @@ def get_body(environ=None, scope=None): res.update({"traceback": exception.traceback}) return JSONEncoder().encode(res) - def get_headers(environ=None, scope=None): - """Get a list of headers.""" - _headers = [("Content-Type", "application/json")] - for key, value in get_original_headers(environ=environ, scope=scope): - if key != "Content-Type": - _headers.append(key, value) - return _headers - - exception.get_headers = get_headers exception.get_body = get_body return exception