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

Fixed response failure for unsupported encoding #2512

Merged

Conversation

prince-melvin
Copy link

FastHttpUser fails the request if the response can't be converted to text. For example, if the response headers have application/octet stream as response header there is no proper encoding to convert it back to text.

This PR allows the request to succeed by,

  1. Check response.content is null for failure
  2. Before attempting to convert to text check if encoding is not None.

(We shall log warning to prompt that response cannot be converted to text and will not be available as a json)

locust/contrib/fasthttp.py Outdated Show resolved Hide resolved
@prince-melvin prince-melvin force-pushed the fix_response_if_not_supported_encoding branch from ea7751a to 8903783 Compare December 12, 2023 06:45
@prince-melvin prince-melvin force-pushed the fix_response_if_not_supported_encoding branch from 8903783 to dfc1491 Compare December 12, 2023 06:50
@cyberw cyberw merged commit ef3e3db into locustio:master Dec 12, 2023
15 checks passed
@cyberw
Copy link
Collaborator

cyberw commented Dec 12, 2023

Thx!

@prince-melvin prince-melvin deleted the fix_response_if_not_supported_encoding branch December 12, 2023 16:20
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

Successfully merging this pull request may close these issues.

None yet

2 participants