Skip to content

Commit

Permalink
Fixed exception handling in case of missing access token
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Jun 20, 2024
1 parent 1b2c5fd commit c6f538a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wopiserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ def iopDownload():
return core.wopi.getFile(0, acctok) # note that here we exploit the non-dependency from fileid
except (jwt.exceptions.DecodeError, jwt.exceptions.ExpiredSignatureError, KeyError) as e:
Wopi.log.info('msg="Expired or malformed token" client="%s" requestedUrl="%s" error="%s" token="%s"' %
(flask.request.remote_addr, flask.request.base_url, e, flask.request.args['access_token']))
(flask.request.remote_addr, flask.request.base_url, e,
(flask.request.args['access_token'] if 'access_token' in flask.request.args else 'N/A')))
return 'Invalid access token', http.client.UNAUTHORIZED


Expand Down

0 comments on commit c6f538a

Please sign in to comment.