File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/brick-kit/src/core Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -909,6 +909,9 @@ describe("Router", () => {
909909 {
910910 url : "/next/blocked-app/blocked-path-2" ,
911911 } ,
912+ {
913+ url : "http://aaa.com" ,
914+ } ,
912915 {
913916 to : { } as unknown as string ,
914917 } ,
@@ -954,6 +957,8 @@ describe("Router", () => {
954957 expect ( spyOnAddPathToBlackList ) . toBeCalledWith (
955958 "/blocked-app/blocked-path-2"
956959 ) ;
960+ expect ( spyOnAddPathToBlackList ) . not . toBeCalledWith ( "http://aaa.com" ) ;
961+
957962 expect ( spyOnIsBlockedPath ) . toBeCalledWith ( "/blocked-app/blocked-path-2" ) ;
958963
959964 spyOnComputeRealValue . mockReset ( ) ;
Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ export class Router {
344344 path = path . replace ( / ^ \/ n e x t \/ / , "/" ) ;
345345 }
346346
347- path && addPathToBlackList ( path ) ;
347+ path && path . startsWith ( "/" ) && addPathToBlackList ( path ) ;
348348 } ) ;
349349
350350 if ( isBlockedPath ( location . pathname ) ) {
You can’t perform that action at this time.
0 commit comments