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

CONNECT with Content-Length hangs the proxy [rt.cpan.org #76988] #12

Open
oalders opened this issue Apr 1, 2019 · 0 comments
Open

CONNECT with Content-Length hangs the proxy [rt.cpan.org #76988] #12

oalders opened this issue Apr 1, 2019 · 0 comments

Comments

@oalders
Copy link
Member

oalders commented Apr 1, 2019

Migrated from rt.cpan.org#76988 (status was 'new')

Requestors:

From vbuttazzo@yahoo.com on 2012-05-04 13:45:17
:

If a client sends a CONNECT to HTTP::Proxy that includes a Content-
Length header then the result is a hang of the proxy.

It's obviously not a normal condition, but it happened on my 
configuration using PHP with cURL and the Google Api library. This 
library explicitly sets a Content-Length header for a POST request and 
cURL sends it in the CONNECT request to the proxy. I think it's a cURL 
wrong behavior, but it was much more easier to fix on the proxy side.

The solution was simply to add this line:

    $len = $ct = $te = undef if $method eq "CONNECT";

after this code:

    my $te  = $r->header('Transfer-Encoding');
    my $ct  = $r->header('Content-Type');
    my $len = $r->header('Content-Length');

This way wrong headers are pretty ignored.

I don't know if anyone else will ever have the same problem, I think 
it's not a common situation, anyway I like to report it.

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