Skip to content

Commit

Permalink
fix in parameter forward #66
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Mar 14, 2018
1 parent e3816b4 commit f9da433
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clam/clamservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ def entryshortcut(credentials = None, fromstart=False): #pylint: disable=too-man
if createresponse is not None:
return createresponse

prefixes = []
for profile in settings.PROFILES:
for inputtemplate in profile.input:
prefixes.append(inputtemplate.id+'_')
data = {'filename':'', 'inputtemplate': inputtemplate.id}
if inputtemplate.id + '_filename' in rq:
data['filename'] = rq[inputtemplate.id + '_filename']
Expand Down Expand Up @@ -318,8 +320,9 @@ def entryshortcut(credentials = None, fromstart=False): #pylint: disable=too-man
#forward any unhandled parameters (issue #66)
forward_rq = []
for key, value in rq.items():
if rq not in ('project','start'):
forward_rq.append((key,value))
if key not in ('project','start'):
if not any( key.startswith(prefix) for prefix in prefixes):
forward_rq.append((key,value))

if oauth_access_token:
return withheaders(flask.redirect(getrooturl() + '/' + project + '/?oauth_access_token=' + oauth_access_token + ('&' if forward_rq else '') + urlencode(forward_rq)),headers={'allow_origin': settings.ALLOW_ORIGIN})
Expand Down

0 comments on commit f9da433

Please sign in to comment.