File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
- const adaptToSiteUrlRegex = / ^ h t t p s ? : \/ \/ ( [ ^ / . ] + - - a d a p t t o - w e b s i t e - - a d a p t t o .h l x .( p a g e | l i v e ) | a d a p t .t o | f r a n k l i n . a d a p t t o . d e | l o c a l h o s t : \d + ) ( \/ .+ ) $ / ;
2
- const adaptToSiteUrlPathnameGroup = 3 ;
1
+ const adaptToSiteUrlRegex = / ^ h t t p s ? : \/ \/ ( [ ^ / . ] + - - a d a p t t o - w e b s i t e - - a d a p t t o .( h l x | a e m ) .( p a g e | l i v e ) | a d a p t .t o | l o c a l h o s t : \d + ) ( \/ .+ ) $ / ;
2
+ const adaptToSiteUrlPathnameGroup = 4 ;
3
3
const downloadUrlRegex = / ^ .+ \. ( p d f | z i p ) $ / ;
4
4
5
5
/**
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ describe('services/LinkHandler', () => {
9
9
it ( 'rewriteUrl' , ( ) => {
10
10
expect ( rewriteUrl ( 'https://adapt.to/mypath' ) ) . to . eq ( '/mypath' ) ;
11
11
expect ( rewriteUrl ( 'https://experimental-download-links--adaptto-website--adaptto.hlx.page/2021/schedule' ) ) . to . eq ( '/2021/schedule' ) ;
12
+ expect ( rewriteUrl ( 'https://experimental-download-links--adaptto-website--adaptto.aem.page/2021/schedule' ) ) . to . eq ( '/2021/schedule' ) ;
12
13
expect ( rewriteUrl ( 'https://main--adaptto-website--adaptto.hlx.live/2021/schedule#day1' ) ) . to . eq ( '/2021/schedule#day1' ) ;
13
14
expect ( rewriteUrl ( 'https://localhost:2000/2021/schedule#day1' ) ) . to . eq ( '/2021/schedule#day1' ) ;
14
15
expect ( rewriteUrl ( 'https://my.host.com/mypath' ) ) . to . eq ( 'https://my.host.com/mypath' ) ;
You can’t perform that action at this time.
0 commit comments