Closed
Description
Version: affects at least Node 4.4.7, 5.7.1, 6.3.0
Platform: Darwin Kernel Version 15.5.0; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
OS: Mac OS X 10.11.5
For a reason I can't understand, a #
symbol in the search
parameter of a URL is formatted inconsistently. The first occurrence (whatever the position) seems to be url-encoded, and subsequent occurrences are not:
$ node
> require('url').format({search:'foo=1#2#3#'})
'?foo=1%232#3#'
> require('url').format({search:'foo=###'})
'?foo=%23##'
> require('url').format({search:'###'})
'?%23##'
This seems to affect Node 4-6 at least, in my testing. It's causing problems in sindresorhus/normalize-url#26.