From d05a725d02c2e88cea8bf390226320acb9afde0e Mon Sep 17 00:00:00 2001 From: falsandtru Date: Sat, 9 Sep 2023 09:31:53 +0900 Subject: [PATCH] Refactoring --- src/layer/domain/router/module/fetch/xhr.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layer/domain/router/module/fetch/xhr.ts b/src/layer/domain/router/module/fetch/xhr.ts index e769748e..6367e792 100644 --- a/src/layer/domain/router/module/fetch/xhr.ts +++ b/src/layer/domain/router/module/fetch/xhr.ts @@ -43,7 +43,7 @@ export function xhr( void verify(base, method, xhr, cache) .fmap(xhr => { const responseURL: URL = new URL( - standardize(fix(xhr.responseURL, displayURL.href), base.href)); + standardize(restore(xhr.responseURL, displayURL.href), base.href)); assert(responseURL.origin === new URL('', window.location.origin).origin); if (method === 'GET') { const cc = new Map( @@ -97,7 +97,7 @@ function request( return xhr; } -function fix(res: string, req: string): string { +function restore(res: string, req: string): string { return !res.includes('#') && req.includes('#') ? res + req.slice(req.indexOf('#')) : res;