Skip to content

Conversation

@feross
Copy link
Member

@feross feross commented Dec 18, 2014

No description provided.

@astro
Copy link
Contributor

astro commented Dec 18, 2014

Hmmm... if /[\@\*\/\+]/g need to be escaped then perhaps the tracker is broken? encodeURIComponent() escapes all but the asterisk. encodeURI() escapes none of these chars.

@feross
Copy link
Member Author

feross commented Dec 22, 2014

No, this change does not affect the tracker server.

The only issue is that the client should escape + in http query params, since the spec says these will be interpreted as spaces. That would make %2b (a + character) be interpreted as %20 by the tracker server which would be bad.

/ and @ should also be escaped according to spec, and that's what encodeURIComponent does. I added * to match the behavior I saw in Transmission, though I don't think it's strictly required.

This fixes webtorrent/webtorrent#196.

feross added a commit that referenced this pull request Dec 22, 2014
encode special characters @*/+ in http tracker urls
@feross feross merged commit 943223d into master Dec 22, 2014
@feross
Copy link
Member Author

feross commented Dec 22, 2014

Released as 2.10.1.

@feross feross deleted the encode-special-chars branch March 24, 2016 12:11
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 this pull request may close these issues.

3 participants