Browse Source

[FIX] : patch odoo get_request from odoo.http, to allow '/oauth/userinfo' pass a GET request with application-type JSON

default 6 months ago
parent
commit
cacf369435
  1. 15
      galicea_openid_connect/controllers/main.py

15
galicea_openid_connect/controllers/main.py

@ -410,3 +410,18 @@ class Main(http.Controller):
response=None,
status=302,
)
from odoo.http import Root, HttpRequest
def patch_get_request(f):
# deduce type of request
def patched(self, httprequest):
if httprequest.path == "/oauth/userinfo" and httprequest.method == "GET":
return HttpRequest(httprequest)
return f(self, httprequest)
return patched
Root.get_request = patch_get_request(Root.get_request)
Loading…
Cancel
Save