Skip to content

Commit f804b5a

Browse files
committedSep 25, 2018
Link test proxy directly to source; Don't use whitelist on localhost
1 parent 7d343de commit f804b5a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎test/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function onClose()
7373

7474
function onAjaxSend(e, x, opts)
7575
{
76-
//if(opts.crossDomain)
76+
// if(opts.crossDomain)
7777
{
7878
x.setRequestHeader('X-Proxy-Url', opts.url);
7979
opts.url = 'proxy.php';
@@ -85,7 +85,7 @@ function onAjaxComplete(e, x, opts)
8585
{
8686
var out = x.status >= 400 ? respBad : respOk;
8787
out += ' ' + x.status + ' ' + x.statusText;
88-
out += '\r\n' + x.getAllResponseHeaders()
88+
out += '\r\n' + x.getAllResponseHeaders();
8989
if(x.responseText)
9090
out += '\r\n' + x.responseText;
9191

‎test/proxy.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
require '../vendor/autoload.php';
3+
require '../src/CrossOriginProxy.php';
44

55
// Example of a whitelist
6-
$whitelist = [
7-
6+
$whitelist = $_SERVER['SERVER_NAME'] == 'localhost' ? [] :
7+
[
88
// Exact matching
99
['http://www.yr.no/place/Sweden/Stockholm/Stockholm/forecast.xml'],
1010

0 commit comments

Comments
 (0)