File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555
5656 fetchPolicy ( sync = false ) {
5757 if ( this . policy ) return ;
58- let url = document . URL ;
58+ let url = window . location . href ;
59+ let origin = window . origin ;
5960
60- debug ( `Fetching policy from document %s, readyState %s` ,
61- url , document . readyState
62- //, document.domain, document.baseURI, window.isSecureContext // DEV_ONLY
61+ debug ( `Fetching policy from document %s (origin %s), readyState %s` ,
62+ url , origin , document . readyState
6363 ) ;
6464
6565 if ( this . domPolicy ) {
8585 return ;
8686 }
8787
88- if ( url . startsWith ( "blob:" ) ) {
89- url = location . origin ;
90- } else if ( / ^ (?: j a v a s c r i p t | a b o u t ) : / . test ( url ) ) {
91- url = document . readyState === "loading" || ! document . domain
92- ? document . baseURI
93- : `${ window . isSecureContext ? "https" : "http" } ://${ document . domain } ` ;
94- debug ( "Fetching policy for actual URL %s (was %s)" , url , document . URL ) ;
88+ if ( origin !== 'null' && window . location . origin !== origin ) {
89+ debug ( "Fetching policy for actual URL %s (was %s)" , origin , url ) ;
90+ url = origin ;
9591 }
9692
9793 if ( ! this . syncFetchPolicy ) {
You can’t perform that action at this time.
0 commit comments