Skip to content

Commit

Permalink
also output CORS headers on redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Jun 19, 2017
1 parent 0228abc commit fc806e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clam/clamservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,9 @@ def start(project, credentials=None): #pylint: disable=too-many-return-statement
statuscode, _, _, _ = Project.status(project, user)
if statuscode != clam.common.status.READY:
if oauth_access_token:
return flask.redirect(getrooturl() + '/' + project + '/?oauth_access_token=' + oauth_access_token)
return withheaders(flask.redirect(getrooturl() + '/' + project + '/?oauth_access_token=' + oauth_access_token),headers={'allow_origin': settings.ALLOW_ORIGIN})
else:
return flask.redirect(getrooturl() + '/' + project)
return withheaders(flask.redirect(getrooturl() + '/' + project),headers={'allow_origin': settings.ALLOW_ORIGIN})

#Generate arguments based on POSTed parameters
commandlineparams = []
Expand Down Expand Up @@ -1102,9 +1102,9 @@ def start(project, credentials=None): #pylint: disable=too-many-return-statement
if shortcutresponse is True:
#redirect to project page to lose parameters in URL
if oauth_access_token:
return flask.redirect(getrooturl() + '/' + project + '/?oauth_access_token=' + oauth_access_token)
return withheaders(flask.redirect(getrooturl() + '/' + project + '/?oauth_access_token=' + oauth_access_token),headers={'allow_origin': settings.ALLOW_ORIGIN})
else:
return flask.redirect(getrooturl() + '/' + project)
return withheaders(flask.redirect(getrooturl() + '/' + project),headers={'allow_origin': settings.ALLOW_ORIGIN})
else:
#normal response (202)
return Project.response(user, project, parameters,"",False,oauth_access_token,",".join([str(x) for x in matchedprofiles_byindex]), program,http_code=202) #returns 202 - Accepted
Expand Down

0 comments on commit fc806e7

Please sign in to comment.