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

FastHttpUser is stricter than HttpUser about the host attribute #2492

Closed
2 tasks done
pjenvey opened this issue Nov 29, 2023 · 0 comments · Fixed by #2493
Closed
2 tasks done

FastHttpUser is stricter than HttpUser about the host attribute #2492

pjenvey opened this issue Nov 29, 2023 · 0 comments · Fixed by #2493
Labels

Comments

@pjenvey
Copy link
Contributor

pjenvey commented Nov 29, 2023

Prerequisites

Description

As a followup to #1222:

FastHttpUser has differences from HttpUser but is documented as a simple drop-in replacement for most cases. The fix for #1222 (#1227) was intended to relax FastHttpUser's host checking to be in line with HttpUser's however there's still a major difference between them: HttpUser doesn't validate the host url format, only ensuring it's not None:

https://github.com/locustio/locust/blob/68ffae8/locust/user/users.py#L252

I don't think there's a compelling reason for these types to differ in their host checks.

I'm using locust against a websocket service where it also uses the FastHttpUser client: in our case we would ideally use host to point to a websocket url but FastHttpUser's stricter check disallows this whereas HttpUser would.

So I think the stricter checking should be removed entirely to bring them into parity.

Command line

locust -f locustfiles/locustfile.py --websocket_url ws://localhost:9150

Locustfile contents

.

Python version

3.10

Locust version

2.19.1

Operating system

Linux

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

Successfully merging a pull request may close this issue.

1 participant