File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ var argv = require('nomnom')
5454 help : 'HTTP Session secret key (e.g. "your secret phrase")' ,
5555 abbr : 's'
5656 } )
57+ . option ( 'xssProxy' , {
58+ full : 'xss-proxy' ,
59+ help : 'Use a proxy on example.tld/xssProxyPath' ,
60+ abbr : 'P'
61+ } )
5762 . option ( 'noLive' , {
5863 full : 'no-live' ,
5964 help : 'Disable live support through WebSockets' ,
Original file line number Diff line number Diff line change @@ -46,14 +46,14 @@ function ldnode (argv) {
4646 resave : false
4747 } ) ) ;
4848
49- // Setting up routes
50- app . use ( '/' , routes ( ) ) ;
51-
5249 // Adding proxy
5350 if ( ldp . xssProxy ) {
5451 proxy ( app , ldp . proxyFilter ) ;
5552 }
5653
54+ // Setting up routes
55+ app . use ( '/' , routes ( ) ) ;
56+
5757 // Setup Express app
5858 if ( ldp . live ) {
5959 ws ( app ) ;
Original file line number Diff line number Diff line change @@ -43,11 +43,18 @@ describe('HTTP APIs', function() {
4343 var address = 'http://localhost:3457' ;
4444 var ldp = ldnode . createServer ( {
4545 root : __dirname + '/resources' ,
46+ xssProxy : '/proxy'
4647 } ) ;
4748 ldp . listen ( 3457 ) ;
4849
4950 var server = supertest ( address ) ;
5051
52+ describe ( 'Proxy' , function ( ) {
53+ it ( 'should return the website in ?uri' , function ( done ) {
54+ server . get ( '/proxy?uri=http://google.com' )
55+ . expect ( 200 , done ) ;
56+ } ) ;
57+ } ) ;
5158
5259 describe ( 'GET Root container' , function ( ) {
5360 it ( 'should have Access-Control-Allow-Origin as the req.Origin' , function ( done ) {
You can’t perform that action at this time.
0 commit comments