Matteo Collina
9c268d0492
url: avoid hostname spoofing w/ javascript protocol
...
CVE-2018-12123
Fixes: https://github.com/nodejs-private/security/issues/205
PR-URL: https://github.com/nodejs-private/node-private/pull/145
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-11-27 14:29:28 +11:00
James M Snell
24def19417
url: adding WHATWG URL support
...
Implements WHATWG URL support. Example:
```
var u = new url.URL('http://example.org ');
```
Many, many other commits improving the implementation have been squashed
into this backport PR. They are not listed separately here for brevity.
Backport-PR-URL: https://github.com/nodejs/node/pull/17365
PR-URL: https://github.com/nodejs/node/pull/7448
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com >
2018-02-12 19:28:11 -05:00
Timothy Gu
60b10f0896
url: update IDNA handling
...
Remove custom tests for invalid IDNA domains in url-idna.js in favor of
the more comprehensive official set.
Backport-PR-URL: https://github.com/nodejs/node/pull/17365
PR-URL: https://github.com/nodejs/node/pull/13362
Refs: https://github.com/whatwg/url/pull/309
Refs: https://github.com/w3c/web-platform-tests/pull/5976
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2018-02-12 19:28:10 -05:00
Yang-Kichang
27af0bb446
url: change variable name to be more descriptive
...
PR-URL: https://github.com/nodejs/node/pull/15551
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-10-25 04:09:44 -04:00
Rich Trott
62de339327
tools: remove legacy indentation linting
...
All linting now uses the current ESLint 4.3.0 indentation linting.
Remove legacy indentation rules.
Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/14515
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
2017-09-05 12:49:50 -04:00
Rich Trott
963ea0e99b
lib: update indentation of ternaries
...
In preparation for stricter indentation linting and to increase code
clarity, update indentation for ternaries in lib.
Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/14247
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-09-05 12:49:50 -04:00
Rich Trott
4dabeeecdd
lib: remove excess indentation
...
In anticipation of stricter linting for indentation, remove instances of
extra indentation that will be flagged by the new rules.
Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/14090
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-09-05 12:49:49 -04:00
Rich Trott
f20ed49b5e
lib: use consistent indentation for ternaries
...
In anticipation of stricter linting for indentation issues, modify
ternary operators in lib that do not conform with the expected ESLint
settings.
Backport-PR-URL: https://github.com/nodejs/node/pull/14835
PR-URL: https://github.com/nodejs/node/pull/14078
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-09-05 12:49:49 -04:00
Ruben Bridgewater
81edf592ae
lib: fix typos
...
Original-PR-URL: https://github.com/nodejs/node/pull/13741
Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Original-Reviewed-By: Roman Reiss <me@silverwind.io >
Original-Reviewed-By: James M Snell <jasnell@gmail.com >
Original-Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/14044
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-08-15 20:57:33 -07:00
Rich Trott
00b6646f93
url: improve descriptiveness of identifier
...
Change variable for protocols that do not always contain `//` to
`noLeadingSlashes` so someone reading the code knows what it means.
PR-URL: https://github.com/nodejs/node/pull/12579
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-05-17 21:32:21 -04:00
Daijiro Wachi
63449972d1
url: use hasIntl instead of try-catch
...
Like the other internal modules, we should use
`process.binding('config').hasIntl` instead of `try-catch`
to make sure `icu` is bonded or not.
PR-URL: https://github.com/nodejs/node/pull/11571
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
2017-04-18 20:02:00 -04:00
Rich Trott
fb2f449acc
tools: update ESLint to current version
...
We have been stalled on ESLint 3.8.0 for some time. Current ESLint is
3.13.0. We have been unable to upgrade because of more aggressive
reporting on some rules, including indentation.
ESLint configuration options and bugfixes are now such that we can
reasonably upgrade.
PR-URL: https://github.com/nodejs/node/pull/10561
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-03-08 17:11:24 -08:00
Timothy Gu
9e6fcbb34c
url: fix surrogate handling in encodeAuth()
...
Currently, the legacy URL stringifier miscalculates the offset of an
extra surrogate, causing the high surrogate to be included unescaped:
> url.format({ auth: '\uD83D\uDE00', hostname: 'a' })
'//%F0%9F%98%80�@a'
PR-URL: https://github.com/nodejs/node/pull/11387
Backport-of: https://github.com/nodejs/node/pull/11161
2017-03-08 17:11:08 -08:00
Axel Monroy
3ac9e01faa
url: add a got host pattern in url.js
...
Add a hostPattern variable for readable purposes
PR-URL: https://github.com/nodejs/node/pull/9653
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-01-31 17:07:48 -05:00
joyeecheung
13b16881ef
test,url: improve escaping in url.parse
...
- rename variables in autoEscapeStr so they are easier to understand
- comment the escaping algorithm
- increase coverage for autoEscapeStr
PR-URL: https://github.com/nodejs/node/pull/10083
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2016-12-20 15:09:30 -05:00
Rich Trott
f3861c200d
lib,test: remove unneeded escaping of /
...
The `/` character does not need to be escaped when occurring inside a
character class in a regular expression. Remove such instances of
escaping in the code base.
PR-URL: https://github.com/nodejs/node/pull/9485
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-12-08 02:33:35 +01:00
Luigi Pinca
f840bc87d6
url: fix off-by-one error in loop handling dots
...
Fixes an error where a loop, used to traverse an array of length `n`,
ran `n + 1` times instead of `n`.
PR-URL: https://github.com/nodejs/node/pull/8420
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2016-09-13 17:04:45 -07:00
Ilkka Myller
6ae7af0fa3
url: keep auth in url.resolve() if host matches
...
Fixes: https://github.com/nodejs/node/issues/8165
PR-URL: https://github.com/nodejs/node/pull/8215
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-09-09 11:06:03 -04:00
Ilkka Myller
eec5d02266
url: url.format() encodes all # in search
...
This commit fixes an error where only the first occurrence of `#` in
`search` parameter is URL encoded, and subsequent occurrences are not.
Also added a test for the case.
Fixes: https://github.com/nodejs/node/issues/8064
PR-URL: https://github.com/nodejs/node/pull/8072
Reviewed-By: James M Snell <jasnell@gmail.com >
Conflicts:
test/parallel/test-url.js
2016-09-09 11:06:03 -04:00
Ilkka Myller
14c7dcbbcd
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 >
2016-08-24 08:37:11 -05:00
James M Snell
d0e24923a6
net: use icu's punycode implementation
...
ICU has a punycode implementation built in. Use it instead of the
javascript implementation because it's much faster.
PR-URL: https://github.com/nodejs/node/pull/7355
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-07-05 22:36:51 +02:00
Alex Kocharin
1b50b80e06
url: drop auth in url.resolve() if host changes
...
Fixes: https://github.com/nodejs/node/issues/1435
PR-URL: https://github.com/nodejs/node/pull/1480
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2016-04-26 12:16:39 -07:00
Brian White
59737b29c7
url: use "empty" object for empty query strings
...
This makes things consistent with the way that the querystring
module creates parsed results.
PR-URL: https://github.com/nodejs/node/pull/6289
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2016-04-26 12:16:21 -07:00
nettofarah
610bd8d567
url: group slashed protocols by protocol name
...
Reorder slashed protocols so they are grouped by protocol name. This is
done so it doesn't look like we're duplicating protocol names at the
bottom of the list.
PR-URL: https://github.com/nodejs/node/pull/5380
Reviewed-By: Evan Lucas <evanlucas@me.com >
2016-02-29 20:26:59 -06:00
Brian White
8b16ba3bbf
url: fix off-by-one error with parse()
...
Fixes: https://github.com/nodejs/node/issues/5393
PR-URL: https://github.com/nodejs/node/pull/5394
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2016-02-27 14:45:20 +01:00
Brian White
7d1d3a6621
url: fix lint and deopt issues
...
The deopt issues arose from the use of const in specific situations
that v8 does not fully support yet.
Fixes: https://github.com/nodejs/node/issues/5299
PR-URL: https://github.com/nodejs/node/pull/5300
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2016-02-18 09:55:03 -08:00
Brian White
db9128135f
url: improve url.parse() performance
...
This commit improves url.parse() performance by 50-210%
with the existing url/url-parse benchmarks. Also, the
optimizations made in url.format() result in a 40%
increase in performance for url.resolve().
Some optimization strategies used in this commit include:
* Combining multiple searches on the same string into a
single loop
* Avoiding unnecessary string.split() and array.join()
* Minimizing creation of temporary strings
* Using a faster alternative to encodeURIComponent,
borrowed from the querystring module
PR-URL: https://github.com/nodejs/node/pull/4892
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ryan Graham <r.m.graham@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
2016-02-18 07:58:21 -05:00
Kári Tristan Helgason
fcae05e4b5
url: change scoping of variables with let
...
Also changes some `var`s to `const` as they never change.
PR-URL: https://github.com/nodejs/node/pull/4867
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-01-27 14:54:50 -08:00
Michaël Zasso
7ce0e04f44
lib: fix style issues after eslint update
...
With an indentation style of two spaces, it is not possible to indent
multiline variable declarations by four spaces. Instead, the var keyword
is used on every new line.
Use const instead of var where applicable for changed lines.
PR-URL: https://github.com/nodejs/io.js/pull/2286
Reviewed-By: Roman Reiss <me@silverwind.io >
2016-01-13 23:16:05 +01:00
Nik Nyby
46eee3018b
doc: fix spelling error in lib/url.js comment
...
PR-URL: https://github.com/nodejs/node/pull/4390
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2015-12-30 12:01:47 -08:00
micnic
20285ad177
lib: Consistent error messages in all modules
...
This commit fixes some error messages that are not consistent with
some general rules which most of the error messages follow.
PR-URL: https://github.com/nodejs/node/pull/3374
Reviewed-By: Roman Reiss <me@silverwind.io >
2015-11-09 20:08:36 +01:00
James M Snell
936c9ffb0f
doc: multiple documentation updates cherry picked from v0.12
...
* doc: improve http.abort description
* doc: mention that mode is ignored if file exists
* docs: Fix default options for fs.createWriteStream()
* Documentation update about Buffer initialization
* doc: add a note about readable in flowing mode
* doc: Document http.request protocol option
* doc, comments: Grammar and spelling fixes
* updated documentation for fs.createReadStream
* Update child_process.markdown, spelling
* doc: Clarified read method with specified size argument.
* docs:events clarify emitter.listener() behavior
* doc: two minor stream doc improvements
* doc: clarify Readable._read and Readable.push
* doc: stream.unshift does not reset reading state
* doc: readable event clarification
* doc: additional refinement to readable event
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noorduis <ben@strongloop.com >
PR-URL: https://github.com/nodejs/io.js/pull/2302
2015-08-05 08:44:55 -07:00
Rich Trott
6c61ca5325
url: fix typo in comment
...
PR-URL: https://github.com/nodejs/io.js/pull/2071
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2015-06-30 13:47:57 -07:00
Yosuke Furukawa
19ffb5cf1c
lib: fix eslint styles
...
PR-URL: https://github.com/iojs/io.js/pull/1539
Fixes: https://github.com/iojs/io.js/issues/1253
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com >
Reviewed-By: Johan Bergström <bugs@bergstroem.nu >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2015-05-09 12:10:02 +09:00
Rod Vagg
702997c1f0
Revert "url: significantly improve the performance of the url module"
...
This reverts commit 3fd7fc429c .
It was agreed that this change contained too much potential ecosystem
breakage, particularly around the inability to `delete` properties off a
`Url` object. It may be re-introduced for a later release, along with
better work on ecosystem compatibility.
PR-URL: https://github.com/iojs/io.js/pull/1602
Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Forrest L Norvell <forrest@npmjs.com >
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com >
Reviewed-By: Isaac Z. Schlueter <i@izs.me >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2015-05-03 20:29:41 -07:00
Rod Vagg
0daed24883
Revert "url: delete href cache on all setter code paths"
...
This reverts commit dbdd81a91b .
It was agreed that this change contained too much potential ecosystem
breakage, particularly around the inability to `delete` properties off a
`Url` object. It may be re-introduced for a later release, along with
better work on ecosystem compatibility.
PR-URL: #1602
Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Forrest L Norvell <forrest@npmjs.com >
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com >
Reviewed-By: Isaac Z. Schlueter <i@izs.me >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2015-05-03 20:29:34 -07:00
Rod Vagg
0f39ef4ca1
Revert "url: fix treatment of some values as non-empty"
...
This reverts commit 66877216bd .
It was agreed that this change contained too much potential ecosystem
breakage, particularly around the inability to `delete` properties off a
`Url` object. It may be re-introduced for a later release, along with
better work on ecosystem compatibility.
PR-URL: #1602
Reviewed-By: Mikeal Rogers <mikeal.rogers@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Forrest L Norvell <forrest@npmjs.com >
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com >
Reviewed-By: Isaac Z. Schlueter <i@izs.me >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2015-05-03 20:28:51 -07:00
Petka Antonov
66877216bd
url: fix treatment of some values as non-empty
...
In addition to null, undefined and the empty string
are treated as empty (removing the component from the url).
The string '#' is treated same as empty values when
setting .hash.
The string '?' is treated same as empty values when
setting .search.
PR-URL: https://github.com/iojs/io.js/pull/1589
Fixes: https://github.com/iojs/io.js/issues/1588
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-05-03 11:29:54 +03:00
Petka Antonov
dbdd81a91b
url: delete href cache on all setter code paths
...
PR-URL: https://github.com/iojs/io.js/pull/1589
Fixes: https://github.com/iojs/io.js/issues/1588
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-05-03 11:26:28 +03:00
Petka Antonov
3fd7fc429c
url: significantly improve the performance of the url module
...
(landed by @rvagg)
PR-URL: https://github.com/iojs/io.js/pull/1561
Reviewed-By: Domenic Denicola <domenic@domenicdenicola.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
2015-05-01 23:12:52 -07:00
Jeffrey Jagoda
1e94057c05
url: fix resolving from non-file to file URLs.
...
When resolving a reference URL with the 'file' scheme an no host
against a base URL without the 'file' scheme, the first path element
of the reference URL is used as the host for the target URL. This
results in an invalid target URL.
This change makes an exception for file URLs so that the host is not
mangled during URL resolution.
PR-URL: https://github.com/iojs/io.js/pull/1277
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Petka Antonov <petka_antonov@hotmail.com >
2015-04-04 13:25:32 +03:00
Alex Kocharin
4bd3620382
url: remove redundant assignment in url.parse
...
PR-URL: https://github.com/iojs/io.js/pull/1095
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Nicu Micleușanu <micnic90@gmail.com >
2015-03-08 16:36:29 -04:00
Christian Tellnes
abb00cc915
url: throw for invalid values to url.format
...
`'use strict'` changes the behavior for `Function.prototype.call` when
the context is `undefined`. In earlier versions of node the value
`undefined` would make `url.format` look for fields in the global scope.
The docs states that `url.format` takes a parsed URL object and returns
a formatted URL string. So with this change it will now throw for other
values.
The exception is if the input is a string. Then it will call `url.parse`
on the string and then format it. The reason for that is that you can
call `url.format` on strings to clean up potentially wonky urls.
Fixes: https://github.com/iojs/io.js/issues/1033
PR-URL: https://github.com/iojs/io.js/pull/1036
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Julian Duque <julianduquej@gmail.com >
2015-03-04 22:04:14 +01:00
Amir Saboury
faa687b4be
url: reslove urls with . and ..
...
'.' and '..' are directory specs and resolving urls with or
without the hostname with '.' and '..' should add a trailing
slash to the end of the url.
Fixes: https://github.com/joyent/node/issues/8992
PR-URL: https://github.com/iojs/io.js/pull/278
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2015-02-13 14:05:05 -05:00
cjihrig
6ac8bdc0ab
lib: reduce util.is*() usage
...
Many of the util.is*() methods used to check data types
simply compare against a single value or the result of
typeof. This commit replaces calls to these methods with
equivalent checks. This commit does not touch calls to the
more complex methods (isRegExp(), isDate(), etc.).
Fixes: https://github.com/iojs/io.js/issues/607
PR-URL: https://github.com/iojs/io.js/pull/647
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-01-31 23:47:29 -05:00
cjihrig
804e7aa9ab
lib: use const to define constants
...
This commit replaces a number of var statements throughout
the lib code with const statements.
PR-URL: https://github.com/iojs/io.js/pull/541
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-01-21 16:21:31 -05:00
isaacs
3e1b1dd4a9
Remove excessive copyright/license boilerplate
...
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Ben Noordhuis
913addbff5
Revert "url: support path for url.format"
...
This reverts commit d312b6d15c .
Reverted for breaking `npm install` with git+ssh URLs.
Conflicts:
doc/api/url.markdown
Fixes: https://github.com/iojs/io.js/issues/295
PR-URL: https://github.com/iojs/io.js/pull/303
Reviewed-By: Rod Vagg <rod@vagg.org >
2015-01-12 12:15:38 +01:00
Evan Lucas
a1e54d6fb7
url: fix parsing of ssh urls
...
Fix regression introduced in 6120472036
that broke parsing of some ssh: urls.
An example url is ssh://git@github.com:npm/npm.git
PR-URL: https://github.com/iojs/io.js/pull/299
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-01-12 10:56:41 +01:00
Ben Noordhuis
94e147500c
Merge remote-tracking branch 'joyent/v0.12' into v1.x
...
I was originally going to do this after the v0.11.15 release, but as
that release is three weeks overdue now, I decided not to wait any
longer; we don't want the delta to get too big.
Conflicts:
lib/net.js
test/simple/simple.status
PR-URL: https://github.com/iojs/io.js/pull/236
Reviewed-By: Bert Belder <bertbelder@gmail.com >
Reviewed-By: Fedor Indutny <fedor@indutny.com >
2015-01-05 17:26:47 +01:00