We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cafa60 commit 8368389Copy full SHA for 8368389
lib/internal/url.js
@@ -577,6 +577,7 @@ function encodeAuth(str) {
577
}
578
// Surrogate pair
579
++i;
580
+ ++lastPos;
581
var c2;
582
if (i < str.length)
583
c2 = str.charCodeAt(i) & 0x3FF;
test/parallel/test-url-format.js
@@ -235,6 +235,15 @@ const formatTests = {
235
protocol: 'file',
236
pathname: '/home/user',
237
path: '/home/user'
238
+ },
239
+
240
+ // surrogate in auth
241
+ 'http://%F0%9F%98%80@www.example.com/': {
242
+ href: 'http://%F0%9F%98%80@www.example.com/',
243
+ protocol: 'http:',
244
+ auth: '\uD83D\uDE00',
245
+ hostname: 'www.example.com',
246
+ pathname: '/'
247
248
};
249
for (const u in formatTests) {
0 commit comments