@@ -329,7 +329,7 @@ describe('ResourceMapper', () => {
329329 } )
330330
331331 describe ( 'A ResourceMapper instance for a multi-host setup with a subfolder root URL' , ( ) => {
332- const rootUrl = 'http ://localhost/foo/bar/'
332+ const rootUrl = 'https ://localhost/foo/bar/'
333333 const mapper = new ResourceMapper ( { rootUrl, rootPath, includeHost : true } )
334334
335335 itMapsFile ( mapper , 'a file on a host' ,
@@ -338,7 +338,61 @@ describe('ResourceMapper', () => {
338338 hostname : 'example.org'
339339 } ,
340340 {
341- url : 'http://example.org/foo/bar/space/foo.html' ,
341+ url : 'https://example.org/foo/bar/space/foo.html' ,
342+ contentType : 'text/html'
343+ } )
344+ } )
345+
346+ describe ( 'A ResourceMapper instance for an HTTP host with non-default port' , ( ) => {
347+ const mapper = new ResourceMapper ( { rootUrl : 'http://localhost:81/' , rootPath } )
348+
349+ itMapsFile ( mapper , 'a file with the port' ,
350+ {
351+ path : `${ rootPath } space/foo.html`
352+ } ,
353+ {
354+ url : 'http://localhost:81/space/foo.html' ,
355+ contentType : 'text/html'
356+ } )
357+ } )
358+
359+ describe ( 'A ResourceMapper instance for an HTTP host with non-default port in a multi-host setup' , ( ) => {
360+ const mapper = new ResourceMapper ( { rootUrl : 'http://localhost:81/' , rootPath, includeHost : true } )
361+
362+ itMapsFile ( mapper , 'a file with the port' ,
363+ {
364+ path : `${ rootPath } space/foo.html` ,
365+ hostname : 'example.org'
366+ } ,
367+ {
368+ url : 'http://example.org:81/space/foo.html' ,
369+ contentType : 'text/html'
370+ } )
371+ } )
372+
373+ describe ( 'A ResourceMapper instance for an HTTPS host with non-default port' , ( ) => {
374+ const mapper = new ResourceMapper ( { rootUrl : 'https://localhost:81/' , rootPath } )
375+
376+ itMapsFile ( mapper , 'a file with the port' ,
377+ {
378+ path : `${ rootPath } space/foo.html`
379+ } ,
380+ {
381+ url : 'https://localhost:81/space/foo.html' ,
382+ contentType : 'text/html'
383+ } )
384+ } )
385+
386+ describe ( 'A ResourceMapper instance for an HTTPS host with non-default port in a multi-host setup' , ( ) => {
387+ const mapper = new ResourceMapper ( { rootUrl : 'https://localhost:81/' , rootPath, includeHost : true } )
388+
389+ itMapsFile ( mapper , 'a file with the port' ,
390+ {
391+ path : `${ rootPath } space/foo.html` ,
392+ hostname : 'example.org'
393+ } ,
394+ {
395+ url : 'https://example.org:81/space/foo.html' ,
342396 contentType : 'text/html'
343397 } )
344398 } )
0 commit comments