Skip to content

Commit a060a81

Browse files
committed
fix (AuthAPI): check if response is a str before wrap it to html
1 parent 5b2bc60 commit a060a81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DIRAC/FrameworkSystem/API/AuthHandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def get_redirect(self, state, error=None, error_description="", chooseScope=[]):
382382

383383
# RESPONSE to basic DIRAC client request
384384
resp = self.server.create_authorization_response(response, grant_user)
385-
if not resp.payload.startswith("<!DOCTYPE html>"):
385+
if isinstance(resp.payload, str) and not resp.payload.startswith("<!DOCTYPE html>"):
386386
resp.payload = getHTML("authorization response", state=resp.status_code, body=resp.payload)
387387
return resp
388388

0 commit comments

Comments
 (0)