[FIX] point_of_sale: Connect to the IoT Box in debug

When using the PoS in debug mode in 12.0, the call to the
'/hw_proxy/handshake' route contains the 'X-Debug-Mode' header.

This header was removed from the 'Access-Control-Allow-Headers' in
13.0, which is used to create the image of the IoT Box.

This means that if the code of http.py was not checked out to 12.0
(i.e. when using an IoT Box in Community), the connection would fail
and none of the devices could be used.

closes odoo/odoo#46442

X-original-commit: e6cfbd35e0878c9c07a98f950495a682c6cff535
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
This commit is contained in:
Antoine Prieels
2020-02-27 13:09:32 +00:00
parent 103e72398a
commit 9db8860840
@@ -1,6 +1,15 @@
--- http_old.py 2019-11-07 15:01:37.190918774 +0100
+++ http_new.py 2019-11-07 15:02:16.406711394 +0100
@@ -1496,7 +1496,7 @@
--- http_old.py 2020-02-27 10:56:47.236000000 +0100
+++ http_new.py 2020-02-27 10:58:30.737536611 +0100
@@ -763,7 +763,7 @@
if request.httprequest.method == 'OPTIONS' and request.endpoint and request.endpoint.routing.get('cors'):
headers = {
'Access-Control-Max-Age': 60 * 60 * 24,
- 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
+ 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, X-Debug-Mode'
}
return Response(status=200, headers=headers)
@@ -1497,7 +1497,7 @@
"""
httprequest = httprequest or request.httprequest