troch / path-parser

A small utility to parse paths.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to treat plus signs (+) as spaces

yndx-madfriend opened this issue · comments

It is common to use literal plus sign in query string as a synonym of space, and many websites support this:
https://google.com?q=foo+bar.

The w3c spec says:

Within the query string, the plus sign is reserved as shorthand notation for a space. Therefore, real plus signs must be encoded. This method was used to make query URIs easier to pass in systems which did not allow spaces.

However, there is a debate whether url encoding / decoding should treat plus signs this way, see https://stackoverflow.com/questions/5450190/how-to-encode-the-plus-symbol-in-a-url.

Can path-parser (and router5) have an option to enable such encoding/decoding of plus signs?