Open GoogleCodeExporter opened 8 years ago
Small typhos:
/**
* Determine the endpoint URI
*/
public function DetermineEndPoint(){
// HTTP / HTTPS
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$protocol = 'https';
} else {
$protocol = 'http';
}
// PORT
if (isset($_SERVER['SERVER_PORT'])) {
if (($protocol == 'https' && $_SERVER['SERVER_PORT'] != 443) ||
($protocol == 'http' && $_SERVER['SERVER_PORT'] != 80)) {
$port = ':'. $_SERVER['SERVER_PORT'];
}else{
$port =$_SERVER['SERVER_PORT'];
}
}
// SERVER_NAME
if (isset($_SERVER['X_FORWARDED_FOR'])) {
$hostname=$_SERVER['X_FORWARDED_FOR'];
}else{
$hostname =$_SERVER['SERVER_NAME'];
}
return $protocol .'://'. $hostname .':'. $port . $_SERVER['SCRIPT_NAME'];
}
/**
* Determine the namespace
*/
public function DetermineNameSpace(){
// SERVER_NAME
if (isset($_SERVER['X_FORWARDED_FOR'])) {
$hostname=$_SERVER['X_FORWARDE_FOR'];
}else{
$hostname =$_SERVER['SERVER_NAME'];
}
return 'http://'.$hostname.str_replace(basename($_SERVER['SCRIPT_NAME']),'',$_SERVER['SCRIPT_NAME']);
}
Original comment by christia...@gmail.com
on 24 Aug 2012 at 7:18
Now also as Patch file
On more issue found: Line764 cause at demo.php
//if(is_null($class)&&$this->IsOnlyGlobal()){
+ if(!isset($class)&&$this->IsOnlyGlobal()){
Tested with PHP Version 5.3.8, Apache, win7
Original comment by christia...@gmail.com
on 26 Aug 2012 at 12:55
Attachments:
I'd prefer to init the $class variable with NULL, but thanks anyway!
The XFF header (as all X-headers) is a very special thing - and it could be
faked, so I'd prefer to set the PhpWsdl->EndPoint and PhpWsdl->NameSpace
manually in this case. I had a look at the Apache documentation:
http://httpd.apache.org/docs/trunk/mod/mod_proxy.html
There the XFF header is described as "The IP address of the client"!? Are you
sure you receive the server name when accessing this header?
Original comment by schickwa...@googlemail.com
on 26 Aug 2012 at 6:49
http://httpd.apache.org/docs/trunk/mod/mod_proxy.html#forwardreverse
X-Forwarded-Host is correct not X-Forwarded-For
Still this works as expected now in our reverse Proxy scenario
I correct it to that, thanks
Original comment by christia...@gmail.com
on 26 Aug 2012 at 8:48
Original issue reported on code.google.com by
christia...@gmail.com
on 23 Aug 2012 at 2:37