File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed
Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ sub process {
2323 if ( $content_type ne ' application/json' ) {
2424 $body = JSON-> new-> allow_nonref-> ascii-> encode($body );
2525 }
26- $c -> res-> body(" $cb ($body );" );
26+ $c -> res-> body(" /**/ $cb ($body );" );
2727 return 1;
2828}
2929
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ test_psgi app, sub {
3434 ' text/javascript; charset=UTF-8' ,
3535 ' Content-type'
3636 );
37- like( $res -> content, qr / ^jsonp\( .*\) ;$ / ms , ' includes jsonp callback' );
37+ like( $res -> content, qr / ^\/\*\*\/ jsonp\( .*\) ;$ / ms , ' includes jsonp callback' );
3838
3939 ok(
4040 $res = $cb -> (
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ test_psgi app, sub {
5959 ' text/javascript; charset=UTF-8' ,
6060 ' Content-type'
6161 );
62- ok( my ($function_args ) = $res -> content =~ / ^foo\( (.*)\) /s ,
62+ ok( my ($function_args ) = $res -> content =~ / ^\/\*\*\/ foo\( (.*)\) /s ,
6363 ' callback included' );
6464 ok( my $jsdata = JSON-> new-> allow_nonref-> decode($function_args ),
6565 ' decode json' );
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ test_psgi app, sub {
4949 )
5050 );
5151 if ( $k =~ / callback=foo/ ) {
52- ok( my ($function_args ) = $res -> content =~ / ^foo\( (.*)\) /s ,
52+ ok( my ($function_args ) = $res -> content =~ / ^\/\*\*\/ foo\( (.*)\) /s ,
5353 ' JSONP wrapper' );
5454 ok(
5555 my $jsdata
@@ -90,7 +90,7 @@ test_psgi app, sub {
9090 ' text/javascript; charset=UTF-8' ,
9191 ' Content-type'
9292 );
93- ok( my ($function_args ) = $res -> content =~ / ^foo\( (.*)\) /s ,
93+ ok( my ($function_args ) = $res -> content =~ / ^\/\*\*\/ foo\( (.*)\) /s ,
9494 ' JSONP wrapper' );
9595 ok(
9696 my $jsdata = JSON-> new-> allow_nonref-> decode($function_args ),
You can’t perform that action at this time.
0 commit comments