diff --git a/src/http.js b/src/http.js index 5e9c3b9e375..babdfa6c96e 100644 --- a/src/http.js +++ b/src/http.js @@ -44,8 +44,8 @@ node.http.STATUS_CODES = { 100 : 'Continue' MIT License */ -function parseUri (str) { - var o = parseUri.options, +node.http.parseUri = function (str) { + var o = node.http.parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; @@ -61,7 +61,7 @@ function parseUri (str) { return uri; }; -parseUri.options = { +node.http.parseUri.options = { strictMode: false, key: [ "source" , "protocol" @@ -296,7 +296,7 @@ node.http.Server = function (RequestHandler, options) { this.onHeadersComplete = function () { req.http_version = this.http_version; req.method = this.method; - req.uri = parseUri(req.uri); + req.uri = parseUri(req.uri); // TODO parse the URI lazily res.should_keep_alive = this.should_keep_alive; diff --git a/website/node.html b/website/node.html index d62f3f99956..3240c60f688 100644 --- a/website/node.html +++ b/website/node.html @@ -181,10 +181,9 @@ simple side-effect free functions. The programmer does not need advanced knowledge of POSIX to know that I/O is being performed because it looks differently. -
Some find event programming cumbersome. -I find threaded programming +
Some find event programming cumbersome. I find threaded programming cumbersome—it's not a good abstraction of what is really happening. -Because of this bad abstraction it's confusing and difficult to get right. +Because of this bad abstraction it's confusing and difficult to get right. Threaded programs only look good in the simpliest and most trivial situations—in real-life applications events lead to better architecture. @@ -216,10 +215,10 @@ always have a capital first letter.
Timers allow one to schedule execution of a function for a later time.
Timers in Node work as they do in the browser:
-setTimeout
,
-setInterval
,
-clearTimeout
,
-clearInterval
.
+setTimeout()
,
+setInterval()
,
+clearTimeout()
,
+clearInterval()
.
See Mozilla's
documentation for more information.
@@ -239,7 +238,7 @@ boundaries, and Keep-Alive connections.
node.http.Server
var server = new node.http.Server(request_handler, options);
new node.http.Server(request_handler, options);
Creates a new web server. @@ -266,8 +265,7 @@ boundaries, and Keep-Alive connections.
server.close()
Stops the server. Requests currently in progress will not be - interrupted. +
Stops the server from accepting new connections.
"DELETE"
.
req.uri
- req.uri.toString()
- req.uri.anchor
req.uri.query
req.uri.file
@@ -301,6 +297,8 @@ class="sh_javascript">request_handler callback.
req.uri.protocol
req.uri.source
req.uri.queryKey
+ req.uri.toString()
+ req.headers