diff options
| -rw-r--r-- | doc/urimethodmap.md | 6 | ||||
| -rw-r--r-- | src/types/urimethodmap.nim | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/doc/urimethodmap.md b/doc/urimethodmap.md index 4bb0d645..4b1bdf06 100644 --- a/doc/urimethodmap.md +++ b/doc/urimethodmap.md @@ -58,8 +58,10 @@ protocol /cgi-bin/interpret-protocol?%s ``` The redirection template is the target URL. If the string `%s` is contained -in the template, it will be replaced by the target URL encoded with the -component percent encode set (i.e. EcmaScript's encodeURIComponent). +in the template, it will be replaced by the target URL. + +Note: Chawan used to URL-encode the substituted URL in the past, but this is +no longer the case. For compatibility with w3m, templates starting with `/cgi-bin/` and `file:/cgi-bin/` are special-cased and the starting string is replaced with diff --git a/src/types/urimethodmap.nim b/src/types/urimethodmap.nim index f2015a70..8453e554 100644 --- a/src/types/urimethodmap.nim +++ b/src/types/urimethodmap.nim @@ -18,7 +18,7 @@ func rewriteURL(pattern, surl: string): string = if c == '%': result &= '%' elif c == 's': - result.percentEncode(surl, ComponentPercentEncodeSet) + result &= surl else: result &= '%' result &= c |