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 @@ -14,7 +14,7 @@ const AZURE_BLOB_REGEXP = /^https:\/\/hlx\.blob\.core\.windows\.net\/external\//
14
14
15
15
const MEDIA_BLOB_REGEXP = / ^ h t t p s : \/ \/ .* \. ( a e m | h l x 3 ? ) \. ( l i v e | p a g e ) \/ m e d i a _ .* / ;
16
16
17
- const HELIX_URL_REGEXP = / ^ h t t p s : \/ \/ (? ! a d m i n \. | w w w \. ) [ ^ . ] + \. ( a e m | h l x 3 ? ) \. ( l i v e | p a g e ) \/ ? .* / ;
17
+ const HELIX_URL_REGEXP = / ^ h t t p s : \/ \/ . * \. ( a e m | h l x 3 ? ) \. ( l i v e | p a g e ) \/ ? .* / ;
18
18
19
19
/**
20
20
* Returns the original host name from the request to the outer CDN.
@@ -208,7 +208,7 @@ export function rewriteUrl(state, url) {
208
208
return `.${ pathname } ${ hash } ` ;
209
209
}
210
210
211
- if ( HELIX_URL_REGEXP . test ( url )
211
+ if ( ( host . includes ( '--' ) && HELIX_URL_REGEXP . test ( url ) )
212
212
|| host === state . previewHost
213
213
|| host === state . liveHost ) {
214
214
if ( hash && pathname === state . info ?. path ) {
Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ describe('Rewrite URLs test', () => {
163
163
it ( 'keeps helix urls for www and admin in place' , ( ) => {
164
164
assert . strictEqual ( rewriteUrl ( { } , 'https://www.hlx.page/docs' ) , 'https://www.hlx.page/docs' ) ;
165
165
assert . strictEqual ( rewriteUrl ( { } , 'https://www.aem.live/docs' ) , 'https://www.aem.live/docs' ) ;
166
+ assert . strictEqual ( rewriteUrl ( { } , 'https://tools.aem.live/docs' ) , 'https://tools.aem.live/docs' ) ;
166
167
assert . strictEqual ( rewriteUrl ( { } , 'https://admin.hlx.live/api' ) , 'https://admin.hlx.live/api' ) ;
167
168
} ) ;
168
169
You can’t perform that action at this time.
0 commit comments