Skip to content

Commit c6f538a

Browse files
committed
Fixed exception handling in case of missing access token
1 parent 1b2c5fd commit c6f538a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wopiserver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ def iopDownload():
392392
return core.wopi.getFile(0, acctok) # note that here we exploit the non-dependency from fileid
393393
except (jwt.exceptions.DecodeError, jwt.exceptions.ExpiredSignatureError, KeyError) as e:
394394
Wopi.log.info('msg="Expired or malformed token" client="%s" requestedUrl="%s" error="%s" token="%s"' %
395-
(flask.request.remote_addr, flask.request.base_url, e, flask.request.args['access_token']))
395+
(flask.request.remote_addr, flask.request.base_url, e,
396+
(flask.request.args['access_token'] if 'access_token' in flask.request.args else 'N/A')))
396397
return 'Invalid access token', http.client.UNAUTHORIZED
397398

398399

0 commit comments

Comments
 (0)