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

URL Requests are truncated via proxy #129

Closed
cetra3 opened this issue Mar 22, 2018 · 5 comments
Closed

URL Requests are truncated via proxy #129

cetra3 opened this issue Mar 22, 2018 · 5 comments

Comments

@cetra3
Copy link
Contributor

cetra3 commented Mar 22, 2018

I'm seeing some weird stuff when trying to proxy requests with large URLs (around 400 characters), whereby it looks like the buffer is overriding the HTTP request headers.

As an example, if set up a proxy to a URL /blah and append the query params from the client.

If I have a small amount of characters, I see this in wireshark:

GET /blah?sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss= HTTP/1.1
host: 127.0.0.1
....

If I append more characters, to the request, then the URL is completely truncated out:

GET host: 127.0.0.1
....

Not really sure what's happening here.

@DoumanAsh
Copy link
Contributor

DoumanAsh commented Mar 22, 2018

@cetra3 Can you check uri of your requests? Is it truncated there too?
All requests/responses have uri() method to access it

@cetra3
Copy link
Contributor Author

cetra3 commented Mar 22, 2018

the URL starts off as a String, then I use the ClientRequestBuilder to set the uri.

If i print out the URL beforehand, it does not appear truncated.

@cetra3
Copy link
Contributor Author

cetra3 commented Mar 22, 2018

Looking at the code, it appears the HttpClientWriter is only allocated 256 bytes for the status line, which may be the culprit

Is there a way to ensure that the buffer is always the appropriate size?

I'm not sure what happens to that type of buffer if the write! call is oversized

@fafhrd91
Copy link
Member

That is bug

fafhrd91 added a commit that referenced this issue Mar 22, 2018
@fafhrd91
Copy link
Member

fixed in master

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

3 participants