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

HttpRequest::getMethod modifies request #1826

Open
rafalwijata opened this issue Dec 18, 2024 · 0 comments
Open

HttpRequest::getMethod modifies request #1826

rafalwijata opened this issue Dec 18, 2024 · 0 comments

Comments

@rafalwijata
Copy link

rafalwijata commented Dec 18, 2024

I was testing HelloWorld example with io_uring backend and found out that
the server sometimes(quite often actually) calls any("/") route rather than get("/") route even though req->getMethod() returns "get" within that any() route.
test command: ./wrk -t 8 -c 1000 -d 10s http://localhost:3000/foo
I found out that's because req->getMethod() modifies the method to lowercase and next calls to req->getCaseSensitiveMethod() returns lowercase as well. That in turn confuses the router.
I don't know what calls req->getMethod() before route, but it's happening. Changing this req->getMethod() to return cache rather than modifying this->headers fixes that issue.

Also, I couldn't reproduce it with epoll backend.

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