Skip to content

Commit

Permalink
bugfix: Fix the misspelling of mapped.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolanglanglang authored and GregBrimble committed Feb 8, 2024
1 parent 5ee33c6 commit 4f66a0e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/kv-asset-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ const getAssetFromKV = async (event: FetchEvent, options?: Partial<Options>): Pr
pathIsEncoded = true;
requestKey = request
} else {
// use default mapRequestToAsset
requestKey = mapRequestToAsset(request)
const mappedRequest = mapRequestToAsset(request)
const mappedRawPathKey = new URL(mappedRequest.url).pathname.replace(/^\/+/, '')
if (ASSET_MANIFEST[decodeURIComponent(mappedRawPathKey)]) {
pathIsEncoded = true;
requestKey = mappedRequest
} else {
requestKey = options.mapRequestToAsset(request)
}
}

const parsedUrl = new URL(requestKey.url)
Expand Down

0 comments on commit 4f66a0e

Please sign in to comment.