Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

url.format on client in IE8 returns incorrect format #6745

Closed
AllSpeeds opened this issue Dec 20, 2013 · 5 comments
Closed

url.format on client in IE8 returns incorrect format #6745

AllSpeeds opened this issue Dec 20, 2013 · 5 comments

Comments

@AllSpeeds
Copy link

IE8 does not deal well with negative numbers in substr. It's a real bummer.

https://github.com/joyent/node/blob/master/lib/url.js#L382

(protocol && protocol.substr(-1) !== ':') protocol += ':';
in IE8 "http:".substr(-1) returns "http:"

Fix:
(protocol && protocol.slice(-1) !== ':') protocol += ':';

@vkurchatkin
Copy link

How is it a node issue? If you are using url with browserify it is better to file an issue in the appropriate repository

@indutny
Copy link
Member

indutny commented Dec 20, 2013

Wrong repository, sorry. Though, I'll probably accept it if you'll send a pull request for it. Note that there're a couple of other substr(<negative number>) usages out there.

@indutny indutny closed this as completed Dec 20, 2013
@vkurchatkin
Copy link

@indutny what's the point? it seems legit according to the spec

@indutny
Copy link
Member

indutny commented Dec 20, 2013

@vkurchatkin indeed it is, but I don't really enjoy having substr calls anyway. Better discuss it in a PR, if there'll be any.

@indutny
Copy link
Member

indutny commented Dec 20, 2013

After considering it for another time, I think it's too much for node.

richardlau pushed a commit to ibmruntimes/node that referenced this issue May 17, 2016
- **buffer**: fix lastIndexOf and indexOf in various edge cases (Anna
  Henningsen) [nodejs#6511](nodejs/node#6511)
- **child_process**: use /system/bin/sh on android (Ben Noordhuis)
  [nodejs#6745](nodejs/node#6745)
- **deps**:
  - upgrade npm to 3.8.9 (Rebecca Turner)
    [nodejs#6664](nodejs/node#6664)
  - upgrade to V8 5.0.71.47 (Ali Ijaz Sheikh)
    [nodejs#6572](nodejs/node#6572)
  - upgrade libuv to 1.9.1 (Saúl Ibarra Corretgé)
    [nodejs#6796](nodejs/node#6796)
  - Intl: ICU 57 bump (Steven R. Loomis)
    [nodejs#6088](nodejs/node#6088)
- **repl**:
  - copying tabs shouldn't trigger completion (Eugene Obrezkov)
    [nodejs#5958](nodejs/node#5958)
  - exports `Recoverable` (Blake Embrey)
    [nodejs#3488](nodejs/node#3488)
- **src**: add O_NOATIME constant (Rich Trott)
  [nodejs#6492](nodejs/node#6492)
- **src,module**: add --preserve-symlinks command line flag (James M
  Snell) [nodejs#6537](nodejs/node#6537)
- **util**: adhere to `noDeprecation` set at runtime (Anna Henningsen)
  [nodejs#6683](nodejs/node#6683)
richardlau pushed a commit to ibmruntimes/node that referenced this issue May 18, 2016
- **buffer**: fix lastIndexOf and indexOf in various edge cases (Anna
  Henningsen) [nodejs#6511](nodejs/node#6511)
- **child_process**: use /system/bin/sh on android (Ben Noordhuis)
  [nodejs#6745](nodejs/node#6745)
- **deps**:
  - upgrade npm to 3.8.9 (Rebecca Turner)
    [nodejs#6664](nodejs/node#6664)
  - upgrade to V8 5.0.71.47 (Ali Ijaz Sheikh)
    [nodejs#6572](nodejs/node#6572)
  - upgrade libuv to 1.9.1 (Saúl Ibarra Corretgé)
    [nodejs#6796](nodejs/node#6796)
  - Intl: ICU 57 bump (Steven R. Loomis)
    [nodejs#6088](nodejs/node#6088)
- **repl**:
  - copying tabs shouldn't trigger completion (Eugene Obrezkov)
    [nodejs#5958](nodejs/node#5958)
  - exports `Recoverable` (Blake Embrey)
    [nodejs#3488](nodejs/node#3488)
- **src**: add O_NOATIME constant (Rich Trott)
  [nodejs#6492](nodejs/node#6492)
- **src,module**: add --preserve-symlinks command line flag (James M
  Snell) [nodejs#6537](nodejs/node#6537)
- **util**: adhere to `noDeprecation` set at runtime (Anna Henningsen)
  [nodejs#6683](nodejs/node#6683)

As of this release the 6.X line now includes 64-bit binaries for Linux
on Power Systems running in big endian mode in addition to the existing
64-bit binaries for running in little endian mode.

PR-URL: nodejs/node#6810
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants