Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle '+' as space in URI (hound-search#313)
Traditional URI encoding uses '+' instead of '%20' to represent spaces in URI parameters, but the decodeURIComponent method does not recognize this representation. This is significant because Chrome's "Manage Search Engines" settings page, which lets users add arbitrary search engines as shortcuts in that browser's location bar, represents spaces using the '+' character. So, if you try to add a local Hound instance to your Chrome search engines, any multi-word search will be replaced by a weird regular expression, as the '+' characters will be retained in the search box. For instance, without this change, if you were to set 'hound' as the shortcut term, then entering 'hound some thing' will send the search parameter '?q=some+thing' to Hound, resulting in a search for the regular expression /some+thing/, matching 'something', 'someething', 'someeeeeeeeething', etc. Regular expression search is not affected by this change, because an actual "+" character entered using this Chrome feature will be encoded as %2B, and the '+' will appear in Hound's search box correctly.
- Loading branch information