From a1846782ba10534e13e58fcedd8b53cc985afb60 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 8 Dec 2017 15:47:59 +0100 Subject: [PATCH] Add support for PATCH method in CORS header --- flatisfy/web/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flatisfy/web/app.py b/flatisfy/web/app.py index 122662b..1583c42 100644 --- a/flatisfy/web/app.py +++ b/flatisfy/web/app.py @@ -73,11 +73,11 @@ def get_app(config): """ # The str() call is required as we import unicode_literal and WSGI # headers list should have plain str type. - bottle.response.headers[str('Access-Control-Allow-Origin')] = '*' - bottle.response.headers[str('Access-Control-Allow-Methods')] = ( - 'PUT, GET, POST, DELETE, OPTIONS' + bottle.response.headers[str('Access-Control-Allow-Origin')] = str('*') + bottle.response.headers[str('Access-Control-Allow-Methods')] = str( + 'PUT, GET, POST, DELETE, OPTIONS, PATCH' ) - bottle.response.headers[str('Access-Control-Allow-Headers')] = ( + bottle.response.headers[str('Access-Control-Allow-Headers')] = str( 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token' )