From 4a615ddd9c29b57dd5b526b46dcbcf4585acd95f Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 11 Dec 2009 15:46:10 -0800 Subject: [PATCH] Add credits, and a "decode" function. --- lib/uri.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/uri.js b/lib/uri.js index 0a530cbcfa6..00614601973 100644 --- a/lib/uri.js +++ b/lib/uri.js @@ -3,11 +3,27 @@ * A URI parser, compliant with assorted RFCs, providing parsing and resolution utilities. **/ +/* +Blatantly stolen with permission from Narwhal, which did the same from Chiron, +and bits taken from parseUri 1.2.1 (c) 2007 Steven Levithan MIT License, +and probably also plagiarizing http://code.google.com/p/js-uri/ in some ways. +Most lines have been changed, please don't blame any of the above persons for +any errors in this file. + +*/ + exports.parse = uri_parse; exports.format = uri_format; exports.resolve = uri_resolve; exports.resolveObject = uri_resolveObject; +exports.decode = uri_decode; +/**** +Decode a URI, replacing + with space +*/ +function uri_decode (s) { + return decodeURIComponent(s.replace(/\+/g, ' ')); +} /**** expressionKeys members of a parsed URI object that you get