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

Set up more intelligent URL path escaping #9

Closed
paulstraw opened this issue Dec 11, 2015 · 1 comment
Closed

Set up more intelligent URL path escaping #9

paulstraw opened this issue Dec 11, 2015 · 1 comment
Assignees

Comments

@paulstraw
Copy link
Contributor

When a non-fully-qualified URL is passed, we're currently not doing any encoding on it (pending #8). This should probably be updated to at least be compliant with the "reserved" section of IETF RFC 3986. I'm going to dig into the best way to handle this. Hopefully URI.js has something helpful built-in, I just have to see if that's the case.

@paulstraw
Copy link
Contributor Author

Alrighty. So, I did a bit more digging on this. IETF RFC 3986 includes the following regular expression in Appendix B, "Parsing a URI Reference with a Regular Expression":

^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

I tested it in Rubular with their test URL and our use case, and either %20 or + are acceptable in any part of the URL. From what I've been able to find, however, the + character is supposed to be interpreted as a literal plus sign when it comes before the query string, instead of a space.

Since we're using URI.js' URI.encodeReserved now anyway, I'm just going to close this issue.

@paulstraw paulstraw self-assigned this Dec 11, 2015
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

No branches or pull requests

1 participant