We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f4d078 commit ad321f8Copy full SHA for ad321f8
.changeset/twenty-turkeys-promise.md
@@ -0,0 +1,5 @@
1
+---
2
+'@sveltejs/adapter-cloudflare': patch
3
4
+
5
+Updated Cloudflare adapter to allow static files with spaces (eg. "Example File.pdf") to be accessed.
packages/adapter-cloudflare/files/worker.js
@@ -6,8 +6,16 @@ init();
6
export default {
7
async fetch(req, env) {
8
const url = new URL(req.url);
9
10
// check generated asset_set for static files
- if (ASSETS.has(url.pathname.substring(1))) {
11
+ let pathname = url.pathname.substring(1);
12
+ try {
13
+ pathname = decodeURIComponent(pathname);
14
+ } catch (err) {
15
+ // ignore
16
+ }
17
18
+ if (ASSETS.has(pathname)) {
19
return env.ASSETS.fetch(req);
20
}
21
0 commit comments