This repository has been archived by the owner on Feb 9, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the PR for?
The PR is trying to fix #99
What happened?
Well,
wrangler publish
will store the original path & filename inside Workers KV, just like the screenshot shows:However,
new URL
will encode path by default:Then?
Since I am a Cloudflare Enterprise customer, the first thing I do is to open a ticket at Cloudflare Support. Then the Technical Support Engineer told me it is a known issue and no ETA for fixes. Then I asked if any workarounds could be provided and received "the workaround that I am aware of which is not ideal, is to migrate away pathes".
Well, I can fix the issue myself.
Instead of letting
wrangler-cli
encoding filename, I create this PR to let kv-asset-handler handle encoded URL by decoding path before handling.Is the changes tested?
At least I have added a test case.