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

Wrong host path parsing #265

Open
Alisa-lisa opened this issue Jul 11, 2023 · 2 comments
Open

Wrong host path parsing #265

Alisa-lisa opened this issue Jul 11, 2023 · 2 comments

Comments

@Alisa-lisa
Copy link

I've just encountered an unexpected behavior. My tests fail with 404 response whenever I try to target an url containing port like: http://localhost:XXXX/some_path.
Curl request: curl -XGET 'http://localhost:8080/api/v1/health' results in following output:

2023-10-11 23:10:30 127.0.0.1:56008 GET /api/v1/health HTTP/1.1
┌─Incoming request
│ GET /api/v1/health HTTP/1.1
│ Accept: */*
│ Host: localhost:8080
│ User-Agent: curl/8.1.2
┌─Outgoing response
│ HTTP/1.1 200 OK
│ Content-Length: 9
│ Content-Type: text/plain; charset=utf-8
│ Date: Tue, 11 Jul 2023 23:10:30 +0200

When using oha with: oha -n 1 'http://localhost:8080/api/v1/health' i get following response:

2023-11-11 23:11:21 127.0.0.1:58418 GET http://localhost:8080/api/v1/health HTTP/1.1
┌─Incoming request
│ GET http://localhost:8080/api/v1/health HTTP/1.1
│ Accept: */*
│ Accept-Encoding: gzip, compress, deflate, br
│ Host: localhost:8080
┌─Outgoing response
│ HTTP/1.1 200 OK
│ Content-Length: 9
│ Content-Type: text/plain; charset=utf-8
│ Date: Tue, 11 Jul 2023 23:11:21 +0200

As you can see, the path in case of oha-request contains domain and port, which is incorrect and will result in 404 response.

@hatoo
Copy link
Owner

hatoo commented Jul 12, 2023

Thanks.
This issue was fixed and I've published v0.6.1 which contains the fix.

see #255

@Alisa-lisa
Copy link
Author

thx a lot! <3

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

2 participants