Skip to content

Commit

Permalink
correct allowed methods and routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Thyra authored Jan 12, 2023
1 parent ebf715e commit 06ac79f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

cors_headers = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Methods': 'POST, OPTIONS',
'Access-Control-Allow-Headers': 'Access-Control-Allow-Headers, Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers'
}

Expand All @@ -25,10 +25,8 @@ def enable_cors():
response.set_header(key, value)


@route('/json2tab', method='POST')
def do_login():
response.set_header('Access-Control-Allow-Origin', '*')
response.set_header('Access-Control-Allow-Headers', '*/*')
@route('/isa-json2tab/json2tab', method='POST')
def convert_isa():
tmp_dir = mkdtemp()
with open(tmp_dir + "/request.json", "wb") as f:
f.write(request.body.read())
Expand Down

0 comments on commit 06ac79f

Please sign in to comment.