Skip to content

Mask false positive on 302 response. 'Redirection' #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions rtcclient/base.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ def get(self, url,
self.log.debug("Get response from %s", url)
response = requests.get(url, verify=verify, headers=headers,
proxies=proxies, timeout=timeout, **kwargs)
if response.status_code != 200:
self.log.error('Failed GET request at <%s> with response: %s',
if response.status_code != 200 and response.status_code != 302:
self.log.error('Failed GET request at <%s> with response: %s (%d)',
url,
response.content)
response.content,
response.status_code)
response.raise_for_status()
return response

Expand Down Expand Up @@ -115,10 +116,11 @@ def post(self, url, data=None, json=None,
verify=verify, headers=headers,
proxies=proxies, timeout=timeout, **kwargs)

if response.status_code not in [200, 201]:
self.log.error('Failed POST request at <%s> with response: %s',
if response.status_code not in [200, 201, 302]:
self.log.error('Failed POST request at <%s> with response: %s (%d)',
url,
response.content)
response.content,
response.status_code)
self.log.info(response.status_code)
response.raise_for_status()
return response
Expand Down