Skip to content

Commit da936f8

Browse files
Ocean-OSdummdidumm
andauthored
fix: remove trailing = signs from hash urls (#1513)
* fix: remove trailing `=` signs from hash urls * Update apps/svelte.dev/src/routes/(authed)/playground/[id]/gzip.js --------- Co-authored-by: Simon H <[email protected]>
1 parent 8999dfd commit da936f8

File tree

1 file changed

+2
-1
lines changed
  • apps/svelte.dev/src/routes/(authed)/playground/[id]

1 file changed

+2
-1
lines changed

apps/svelte.dev/src/routes/(authed)/playground/[id]/gzip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export async function compress_and_encode_text(input) {
66
const { done, value } = await reader.read();
77
if (done) {
88
reader.releaseLock();
9-
return btoa(buffer).replaceAll('+', '-').replaceAll('/', '_');
9+
// Some sites like discord don't like it when links end with =
10+
return btoa(buffer).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, '');
1011
} else {
1112
for (let i = 0; i < value.length; i++) {
1213
// decoding as utf-8 will make btoa reject the string

0 commit comments

Comments
 (0)