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

Extra / at start of request paths #235

Closed
willbryant opened this issue Jan 25, 2015 · 3 comments
Closed

Extra / at start of request paths #235

willbryant opened this issue Jan 25, 2015 · 3 comments

Comments

@willbryant
Copy link

The example script:

def login(l):
    l.client.post("/login", {"username":"ellen_key", "password":"education"})

Actually makes a request to //login. Some HTTP servers will treat that as /login, but others will issue a redirect (301) to /login, which has the side effect of turning the POST request into a GET. This is very confusing and doesn't end up working!

I think that the leading / should only be added if it is missing (if at all).

@jaylett
Copy link

jaylett commented Jun 22, 2015

Shouldn't URLs be constructed using urlparse / urllib.parse? I think that would solve this.

@justiniso
Copy link
Member

I'm fairly certain this is because your host had a trailing slash when specified in the command.

--host http://host.com/

@calebwoofenden
Copy link

Couldn't locust be updated so that it can handle URLs with / at the end? Seems like an easy task that could save a lot of confusion.

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

No branches or pull requests

4 participants