Skip to content

Commit db03570

Browse files
committed
Header name
1 parent 47d7cb0 commit db03570

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

proxy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
// Get stuff
1818
$headers = getallheaders();
1919
$method = __('REQUEST_METHOD', $_SERVER);
20-
$url = __('X-Proxy-URL', $headers);
20+
$url = __('X-Proxy-Url', $headers);
2121
$cookie = __('X-Proxy-Cookie', $headers);
2222

2323
// Check that we have a URL
2424
if( ! $url)
25-
http_response_code(400) and exit("X-Proxy-URL header missing");
25+
http_response_code(400) and exit("X-Proxy-Url header missing");
2626

2727
// Check that the URL looks like an absolute URL
2828
if( ! parse_url($url, PHP_URL_SCHEME))
2929
http_response_code(403) and exit("Not an absolute URL: $url");
3030

3131
// Check referer hostname
3232
if( ! parse_url(__('Referer', $headers), PHP_URL_HOST) == $_SERVER['HTTP_HOST'])
33-
http_response_code(403) and exit("Referer mismatch");
33+
http_response_code(403) and exit("Invalid referer");
3434

3535
// Check whitelist, if not empty
3636
if( ! empty($whitelist) and ! array_reduce($whitelist, 'whitelist', [$url, false]))

test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{
2222
//if(options.crossDomain)
2323
{
24-
jqxhr.setRequestHeader('X-Proxy-URL', options.url);
24+
jqxhr.setRequestHeader('X-Proxy-Url', options.url);
2525
options.url = 'proxy.php';
2626
options.url += '?_='+Date.now();
2727
}

0 commit comments

Comments
 (0)