This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +8
-1
lines changed 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 145
145
/* urlUtils.js */
146
146
"urlResolve" : false ,
147
147
"urlIsSameOrigin" : false ,
148
+ "urlIsSameOriginAsBaseUrl" : true ,
148
149
149
150
/* karma */
150
151
"dump" : false ,
Original file line number Diff line number Diff line change @@ -23,11 +23,17 @@ describe('urlUtils', function() {
23
23
} ) ;
24
24
} ) ;
25
25
26
- describe ( 'isSameOrigin' , function ( ) {
26
+ describe ( 'isSameOrigin and urlIsSameOriginAsBaseUrl ' , function ( ) {
27
27
it ( 'should support various combinations of urls - both string and parsed' , inject ( function ( $document ) {
28
28
function expectIsSameOrigin ( url , expectedValue ) {
29
29
expect ( urlIsSameOrigin ( url ) ) . toBe ( expectedValue ) ;
30
30
expect ( urlIsSameOrigin ( urlResolve ( url ) ) ) . toBe ( expectedValue ) ;
31
+
32
+ // urlIsSameOriginAsBaseUrl() should behave the same as urlIsSameOrigin() by default.
33
+ // Behavior when there is a non-default base URL or when the base URL changes dynamically
34
+ // is tested in the end-to-end tests in e2e/tests/base-tag.spec.js.
35
+ expect ( urlIsSameOriginAsBaseUrl ( url ) ) . toBe ( expectedValue ) ;
36
+ expect ( urlIsSameOriginAsBaseUrl ( urlResolve ( url ) ) ) . toBe ( expectedValue ) ;
31
37
}
32
38
expectIsSameOrigin ( 'path' , true ) ;
33
39
var origin = urlResolve ( $document [ 0 ] . location . href ) ;
You can’t perform that action at this time.
0 commit comments