mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
url: fix inconsistent port in url.resolveObject
This commit fixes bug where url.resolveObject returns conflicting host and port values. Fixes: https://github.com/nodejs/node/issues/8213 PR-URL: https://github.com/nodejs/node/pull/8214 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
d863619a30
commit
14c7dcbbcd
2 files changed
+6
No files matched your search
@@ -776,6 +776,7 @@ Url.prototype.resolveObject = function(relative) {
|
||||
// it's absolute.
|
||||
if (relative.host || relative.host === '') {
|
||||
result.host = relative.host;
|
||||
result.port = relative.port;
|
||||
result.auth = null;
|
||||
}
|
||||
if (relative.hostname || relative.hostname === '') {
|
||||
|
||||
@@ -1540,6 +1540,11 @@ var relativeTests2 = [
|
||||
'http://asdf:qwer@www.example.com',
|
||||
'http://diff:auth@www.example.com/'],
|
||||
|
||||
// changing port
|
||||
['https://example.com:81/',
|
||||
'https://example.com:82/',
|
||||
'https://example.com:81/'],
|
||||
|
||||
// https://github.com/nodejs/node/issues/1435
|
||||
['https://another.host.com/',
|
||||
'https://user:password@example.org/',
|
||||
|
||||
Reference in new issue
Block a user