File tree Expand file tree Collapse file tree 2 files changed +25
-18
lines changed Expand file tree Collapse file tree 2 files changed +25
-18
lines changed Original file line number Diff line number Diff line change @@ -432,21 +432,23 @@ class ControlServer {
432432 // transparent and correct.
433433 // * Ignore <heading> and <head-thing>.
434434 // * Support <head x=y...>, including with tabs or newlines before ">".
435- html = util . replaceOnce ( html , [
436- / < h e a d (?: \s [ ^ > ] * ) ? > / i,
437- / < h t m l (?: \s [ ^ > ] * ) ? > / i,
438- / < ! d o c t y p e [ ^ > ] * > / i,
439- / ^ /
440- ] ,
441- ( m ) => m + headInjectHtml
435+ html = util . replaceOnce ( html ,
436+ [
437+ / < h e a d (?: \s [ ^ > ] * ) ? > / i,
438+ / < h t m l (?: \s [ ^ > ] * ) ? > / i,
439+ / < ! d o c t y p e [ ^ > ] * > / i,
440+ / ^ /
441+ ] ,
442+ ( m ) => m + headInjectHtml
442443 ) ;
443444
444- html = util . replaceOnce ( html , [
445- / < \/ b o d y > (? ! [ \s \S ] * < \/ b o d y > ) / i,
446- / < \/ h t m l > (? ! [ \s \S ] * < \/ h t m l > ) / i,
447- / $ /
448- ] ,
449- ( m ) => '<script>(' + util . fnToStr ( qtapClientBody , qtapTapUrl ) + ')();</script>' + m
445+ html = util . replaceOnce ( html ,
446+ [
447+ / < \/ b o d y > (? ! [ \s \S ] * < \/ b o d y > ) / i,
448+ / < \/ h t m l > (? ! [ \s \S ] * < \/ h t m l > ) / i,
449+ / $ /
450+ ] ,
451+ ( m ) => '<script>(' + util . fnToStr ( qtapClientBody , qtapTapUrl ) + ')();</script>' + m
450452 ) ;
451453
452454 return {
Original file line number Diff line number Diff line change @@ -506,11 +506,16 @@ QUnit.module('qtap', function (hooks) {
506506 assert . timeout ( 40_000 ) ;
507507
508508 const server = http . createServer ( ( req , resp ) => {
509- resp . writeHead ( 200 ) ;
510- resp . end (
511- '# console: Origin server URL is ' + req . url + '\n'
512- + 'TAP version 13\nok 1 Foo\nok 2 Bar\n1..2\n'
513- ) ;
509+ if ( req . url . startsWith ( '/test/example.html' ) ) {
510+ resp . writeHead ( 200 ) ;
511+ resp . end (
512+ '# console: Origin server URL is ' + req . url + '\n'
513+ + 'TAP version 13\nok 1 Foo\nok 2 Bar\n1..2\n'
514+ ) ;
515+ } else {
516+ resp . writeHead ( 404 ) ;
517+ resp . end ( 'Not Found\n' ) ;
518+ }
514519 } ) ;
515520 server . listen ( ) ;
516521 const port = await new Promise ( ( resolve ) => {
You can’t perform that action at this time.
0 commit comments