Skip to content

Commit fd3eaf0

Browse files
committed
Redacted log that may contain an access token
1 parent 952bfc6 commit fd3eaf0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/wopiserver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@ def iopOpenInApp():
371371
res['app-url'] += '&IsLicensedUser=1'
372372
res['form-parameters'] = {'access_token': acctok}
373373

374-
Wopi.log.info(f"msg=\"iopOpenInApp: redirecting client\" appurl=\"{res['app-url']}\"")
374+
appforlog = res['app-url']
375+
if appforlog.find('access') > 0:
376+
appforlog = appforlog[:appforlog.find('access')] + 'access_token=redacted'
377+
Wopi.log.info(f"msg=\"iopOpenInApp: redirecting client\" appurl=\"{appforlog}\"")
375378
return flask.Response(json.dumps(res), mimetype='application/json')
376379

377380

0 commit comments

Comments
 (0)