Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xbps-fetch: tilde character shouldn't be url-escaped #606

Open
gmbeard opened this issue Dec 7, 2024 · 2 comments · May be fixed by #607
Open

xbps-fetch: tilde character shouldn't be url-escaped #606

gmbeard opened this issue Dec 7, 2024 · 2 comments · May be fixed by #607

Comments

@gmbeard
Copy link

gmbeard commented Dec 7, 2024

When using xbps-fetch, the tilde (~) character is being url encoded into %7e. This is causing at least one xbps srcpkg to fail when downloading its distfiles .

For example, the following fails to find the udptunnel distfile (note the tilde character in the path)...

$ xbps-fetch -v 'http://www.cs.columbia.edu/~lennox/udptunnel/udptunnel-1.1.tar.gz'

Examining the TTY output, I can see that the tilde is being url encoded...

requesting http://www.cs.columbia.edu/%7elennox/udptunnel/udptunnel-1.1.tar.gz

Using curl to download this file works fine.

gmbeard added a commit to gmbeard/xbps that referenced this issue Dec 7, 2024
This prevents the tilde (`~`) character from being incorrectly encoded
as `%7e` in paths.

For example, this URL didn't previously resolve correctly...

```
http://www.cs.columbia.edu/~lennox/udptunnel/udptunnel-1.1.tar.gz
```

Fixes void-linux#606
@gmbeard gmbeard linked a pull request Dec 7, 2024 that will close this issue
@leahneukirchen
Copy link
Member

Citing RFC 2396:

2.3 Unreserved Characters

   Data characters that are allowed in a URI but do not have a reserved
   purpose are called unreserved.  These include upper and lower case
   letters, decimal digits, and a limited set of punctuation marks and
   symbols.

      unreserved  = alphanum | mark

      mark        = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"

   Unreserved characters can be escaped without changing the semantics
   of the URI, but this should not be done unless the URI is being used
   in a context that does not allow the unescaped character to appear.

So I think the server is broken, but xbps probably still shouldn't encode the tilde.

@gmbeard gmbeard changed the title xbps-fetch: tilde character is incorrectly url-encoded xbps-fetch: tilde character shouldn't be url-escaped Dec 7, 2024
@gmbeard
Copy link
Author

gmbeard commented Dec 7, 2024

@leahneukirchen Agreed. I've changed the issue title so as not to assign blame to xbps-fetch 🙂

gmbeard added a commit to gmbeard/xbps that referenced this issue Dec 8, 2024
This prevents the tilde (`~`) character from being escaped as
`%7e` in paths.

For example, this URL didn't previously resolve correctly...

```
http://www.cs.columbia.edu/~lennox/udptunnel/udptunnel-1.1.tar.gz
```

Fixes void-linux#606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants