Skip to content

Commit

Permalink
Merge pull request #166 from DMTF/Fix165-Auth-ServiceRoot-Workaround
Browse files Browse the repository at this point in the history
Added workaround for services incorrectly responding with 401 when accessing the service root
  • Loading branch information
mraineri authored Nov 15, 2024
2 parents a7e7f62 + 905594b commit 14f35cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/redfish/rest/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,13 @@ def get_root_object(self):
except Exception as excp:
raise excp

if resp.status == 401 and self.__authorization_key is None and self.__session_key is None:
# Workaround where the service incorrectly rejects access to service
# root when no credentials are provided
warnings.warn("Service incorrectly responded with HTTP 401 Unauthorized for the service root. Contact your vendor.")
self.root = {}
self.root_resp = resp
return
if resp.status != 200:
raise ServerDownOrUnreachableError("Server not reachable, " \
"return code: %d" % resp.status,response=resp)
Expand Down

0 comments on commit 14f35cd

Please sign in to comment.