Skip to content

Commit ae70c89

Browse files
committed
Merge pull request softius#11 from aaparmeggiani/master
Allows the forwarding of Content-* headers necessary to POST/JSON
2 parents 85ff781 + 5b61b96 commit ae70c89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

proxy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* AJAX Cross Domain (PHP) Proxy 0.8
55
* by Iacovos Constantinou (http://www.iacons.net)
6-
*
6+
*
77
* Released under CC-GNU GPL
88
*/
99

@@ -37,8 +37,8 @@
3737
// identify request headers
3838
$request_headers = array( );
3939
foreach ( $_SERVER as $key => $value ) {
40-
if ( substr( $key, 0, 5 ) == 'HTTP_' ) {
41-
$headername = str_replace( '_', ' ', substr( $key, 5 ) );
40+
if ( strpos($key, 'HTTP_') === 0 || strpos($key, 'CONTENT_') === 0 ) {
41+
$headername = str_replace( '_', ' ', str_replace('HTTP_', '', $key));
4242
$headername = str_replace( ' ', '-', ucwords( strtolower( $headername ) ) );
4343
if ( !in_array( $headername, array( 'Host', 'X-Proxy-Url' ) ) ) {
4444
$request_headers[] = "$headername: $value";

0 commit comments

Comments
 (0)