about summary refs log tree commit diff
path: root/index.web.js
diff options
context:
space:
mode:
authorJason Culverhouse <jason@mischievous.org>2025-03-28 16:50:16 -0700
committerGitHub <noreply@github.com>2025-03-28 16:50:16 -0700
commit036bbfbaf9476b5bb8f05b8e37b066040758d64d (patch)
treea0c2b0dd403758f849e5f65ba4916b60b6091e34 /index.web.js
parent7c124a870585758336e8d274ff60d3973c324047 (diff)
downloadvoidsky-036bbfbaf9476b5bb8f05b8e37b066040758d64d.tar.zst
Remove double decode of URI (#8068)
At this point the URI is already decoded and decoding again will alter the uri 

```
      let link = req.query.u
```

example  of a link that has `%` encoding... the initial redirect link is properly encoded.

```
curl -vv "https://go.bsky.app/redirect?u=https%3A%2F%2Fsurf.social%2Ffeed%2Fsurf%252Fcustom%252F01jpz5vyjwvw5yaa8bfkha5xn4" 
```
The result is "double decoded", the proper link in this case should be `https://surf.social/feed/surf%2Fcustom%2F01jpz5vyjwvw5yaa8bfkha5xn4`

```
<html><head><meta http-equiv="refresh" content="0; URL='https://surf.social/feed/surf/custom/01jpz5vyjwvw5yaa8bfkha5xn4'" /><style>:root { color-scheme: light dark; }</style></head></html>
```

After changes:

```
curl -s "http://localhost:3000/redirect?u=https%3A%2F%2Fsurf.social%2Ffeed%2Fsurf%252Fcustom%252F01jpz5vyjwvw5yaa8bfkha5xn4"
<html><head><meta http-equiv="refresh" content="0; URL='https://surf.social/feed/surf%2Fcustom%2F01jpz5vyjwvw5yaa8bfkha5xn4'" /><style>:root { color-scheme: light dark; }</style></head></html>
```
Diffstat (limited to 'index.web.js')
0 files changed, 0 insertions, 0 deletions