Skip to content

Commit d587eaf

Browse files
author
Pat Patterson
committed
Merged cwarden's change for http-prefixed content-* headers
2 parents df6db59 + b187b60 commit d587eaf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

proxy.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@
234234
isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET' );
235235

236236
// Pass on content, regardless of request method
237-
if ( isset($_SERVER['CONTENT_LENGTH'] ) && $_SERVER['CONTENT_LENGTH'] > 0 ) {
237+
if ( (isset($_SERVER['CONTENT_LENGTH'] ) && $_SERVER['CONTENT_LENGTH'] > 0) ||
238+
(isset($_SERVER['HTTP_CONTENT_LENGTH'] ) && $_SERVER['HTTP_CONTENT_LENGTH'] > 0) ) {
238239
curl_setopt( $ch, CURLOPT_POSTFIELDS, file_get_contents("php://input") );
239240
}
240241

@@ -259,9 +260,12 @@
259260
if ( isset($_SERVER['CONTENT_TYPE']) ) {
260261
// Pass through the Content-Type header
261262
array_push($headers, "Content-Type: ".$_SERVER['CONTENT_TYPE'] );
262-
}
263+
} elseif ( isset($_SERVER['HTTP_CONTENT_TYPE']) ) {
264+
// Pass through the Content-Type header
265+
array_push($headers, "Content-Type: ".$_SERVER['HTTP_CONTENT_TYPE'] );
266+
}
263267
if ( isset($_SERVER['HTTP_SOAPACTION']) ) {
264-
// Pass through the SOAPAction header
268+
// Pass through the SOAPAction header
265269
array_push($headers, "SOAPAction: ".$_SERVER['HTTP_SOAPACTION'] );
266270
}
267271
if ( isset($_SERVER['HTTP_X_USER_AGENT']) ) {

0 commit comments

Comments
 (0)