Unreserved characters are escaped when making a HTTP request
- Version: >=10.20.1
- Platform: all
- Subsystem: http
What steps will reproduce the bug?
const http = require('http'); const url = new URL('http://httpbin.org/anything?a=~'); url.search = url.searchParams.toString(); // trigger normalization const request = http.get(url, response => { const chunks = []; response.on('data', chunk => { chunks.push(chunk); }); response.once('end', () => { console.log(request._header); // Actual: // GET /anything?a=%7E // // Expected: // GET /anything?a=~ }); })
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
What do you see instead?
Additional information
According to tools.ietf.org/html/rfc3986#section-2.3 tilde is unreserved and should not encoded by URI producers.