|
@ -410,3 +410,23 @@ class Main(http.Controller): |
|
|
response=None, |
|
|
response=None, |
|
|
status=302, |
|
|
status=302, |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from odoo.http import Root, HttpRequest |
|
|
|
|
|
|
|
|
|
|
|
def patch_get_request(f): |
|
|
|
|
|
""" |
|
|
|
|
|
Monkey Patching : |
|
|
|
|
|
escaping classic odoo behavior in a specific situation : |
|
|
|
|
|
in order to allow /oauth/userinfo GET request to be accepted |
|
|
|
|
|
with content-type = application/json |
|
|
|
|
|
""" |
|
|
|
|
|
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) |