Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
falsandtru committed Sep 9, 2023
1 parent f9c61aa commit d05a725
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/layer/domain/router/module/fetch/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function xhr(
void verify(base, method, xhr, cache)
.fmap(xhr => {
const responseURL: URL<StandardURL> = 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<string, string>(
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d05a725

Please sign in to comment.