Skip to content
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

client.py does not properly handle 502 response #3

Open
gvauter opened this issue Jun 13, 2017 · 0 comments
Open

client.py does not properly handle 502 response #3

gvauter opened this issue Jun 13, 2017 · 0 comments

Comments

@gvauter
Copy link
Contributor

gvauter commented Jun 13, 2017

Need to adjust handle_response logic to account for 502 responses. It appears Threat Stack sends back and HTML response for 502s.

Example:
{'_content': b'

502 Bad Gateway

\nThe server returned an invalid or incomplete response.\n\n', '_content_consumed': True, '_next': None, 'status_code': 502, 'headers': {'Cache-Control': 'no-cache', 'Connection': 'close', 'Content-Type': 'text/html'}, 'raw': <urllib3.response.HTTPResponse object at 0x10e3c52e8>, 'url': 'https://app.threatstack.com/api/v1/alerts?count=100&page=3', 'encoding': 'ISO-8859-1', 'history': [], 'reason': 'Bad Gateway', 'cookies': <RequestsCookieJar[]>, 'elapsed': datetime.timedelta(0, 120, 144756), 'request': <PreparedRequest [GET]>, 'connection': <requests.adapters.HTTPAdapter object at 0x10e3c5c50>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant