Permalink
Browse files

Fixed change of request uri.path -> url

  • Loading branch information...
Jonas Pfenniger
Jonas Pfenniger committed Feb 8, 2010
1 parent 0c4dcfe commit f3f25a21ead3b0739cb952fdeffb00773ceace6e
Showing with 5 additions and 5 deletions.
  1. +2 −2 example/chat.js
  2. +1 −1 example/ping.js
  3. +1 −1 example/shared.js
  4. +1 −1 lib/http/websocket.js
View
@@ -26,12 +26,12 @@ chat.addListener("message", function(msg, conn) {
});
function handler(req, res) {
- sys.debug(req.method + ' ' + req.uri.path);
+ sys.debug(req.method + ' ' + req.url);
if (ws.askUpgrade(req)) {
sys.debug("Upgrading to WebSocket");
chat.connect(req, res);
} else {
- var filePath = publicDir + req.uri.path;
+ var filePath = publicDir + req.url;
sendFile(req, res, filePath);
}
}
View
@@ -26,7 +26,7 @@ function handler(req, res) {
sys.debug("Closing WebSocket");
});
} else {
- var filePath = publicDir + req.uri.path;
+ var filePath = publicDir + req.url;
sendFile(req, res, filePath);
}
}
View
@@ -11,7 +11,7 @@ const mimeMap = {
function notFound(req, res) {
- var msg = "<h1>File not found : " + req.uri.path + "</h1>";
+ var msg = "<h1>File not found : " + req.url + "</h1>";
res.sendHeader(404, {
"Content-Type": "text/html",
"Content-Length": msg.length
View
@@ -54,7 +54,7 @@ function Connection(request, response) {
"Connection": "Upgrade",
"WebSocket-Origin": request.headers.origin,
// TODO: wss://
- "WebSocket-Location": "ws://" + request.headers.host + request.uri.path
+ "WebSocket-Location": "ws://" + request.headers.host + request.url
});
response.flush(); // send!!
}

0 comments on commit f3f25a2

Please sign in to comment.