File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -306,12 +306,13 @@ module.exports = {
306306 app . use ( ( req , resp , next ) => {
307307 const fastbootQueryParam = ( req . query . hasOwnProperty ( 'fastboot' ) && req . query . fastboot === 'false' ) ? false : true ;
308308 const enableFastBootServe = ! process . env . FASTBOOT_DISABLED && fastbootQueryParam ;
309- const broccoliHeader = req . headers [ 'x-broccoli' ] ;
310- const outputPath = broccoliHeader [ 'outputPath' ] ;
311309
312310 if ( req . serveUrl && enableFastBootServe ) {
313311 // if it is a base page request, then have fastboot serve the base page
314312 if ( ! this . fastboot ) {
313+ const broccoliHeader = req . headers [ 'x-broccoli' ] ;
314+ const outputPath = broccoliHeader [ 'outputPath' ] ;
315+
315316 // TODO(future): make this configurable for allowing apps to pass sandboxGlobals
316317 // and custom sandbox class
317318 this . ui . writeLine ( chalk . green ( 'App is being served by FastBoot' ) ) ;
Original file line number Diff line number Diff line change @@ -40,6 +40,18 @@ describe('rootUrl acceptance', function() {
4040 } ) ;
4141 } ) ;
4242
43+ it ( 'Out of scope requests' , function ( ) {
44+ return request ( {
45+ url : 'http://localhost:49741/foo-bar/' ,
46+ headers : {
47+ 'Accept' : 'text/html'
48+ }
49+ } )
50+ . then ( function ( response ) {
51+ expect ( response . statusCode ) . to . equal ( 404 ) ;
52+ } ) ;
53+ } ) ;
54+
4355 it ( 'with fastboot query parameter turned on' , function ( ) {
4456 return request ( {
4557 url : 'http://localhost:49741/my-root/?fastboot=true' ,
You can’t perform that action at this time.
0 commit comments