Commit 77343f3
committed
Added support for multiple chained proxies that append a comma and their hostnames to the previous X-Forwarded-Host header.
If we have Client <---> Fwd Proxy1 (first.proxy) <---> Fwd Proxy2 (second.proxy )<---> Application (third.server), then we
will have these values for a script executed on third.server::
$_SERVER['HTTP_X_FORWARDED_HOST'] = 'first.proxy, second.proxy';
$_SERVER['HTTP_HOST'] = 'third.server';
If we use the raw value from $_SERVER['HTTP_X_FORWARDED_HOST'] for composing return URLs, we will generate invalid return URLs,
in our case 'http://first.proxy, second.proxy/fb_oauth.php', and get a 'Oauth exception 191' or some other error message.
If we properly process the X-Forwarded-Host value by taking the leftmost host, we will not get errors.1 parent 69351a5 commit 77343f3
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
| 1159 | + | |
1160 | 1160 | | |
1161 | 1161 | | |
1162 | 1162 | | |
| |||
0 commit comments