php-cross-domain-proxy icon indicating copy to clipboard operation
php-cross-domain-proxy copied to clipboard

Duplicated Content-* headers sent to target URL

Open A-Circle-Zhang opened this issue 3 years ago • 0 comments

When there is a Content-Type header in the request,

My PHP environment will set both CONTENT_TYPE and HTTP_CONTENT_TYPE to the $_SERVER variable.

also Content-Length or any Content-* header.

https://github.com/softius/php-cross-domain-proxy/blob/be3713962b05902324ce8503bc36379cbbb1fd22/proxy.php#L67

This code causes duplicated Content-Type headers sent to target URL.

Most servers just ignore duplicated headers and automatically choose the last one,

but some strict server will response a 400 Bad Request when duplicated headers received.

A-Circle-Zhang avatar Feb 27 '21 06:02 A-Circle-Zhang