Skip to content

Commit f3f25a2

Browse files
author
Jonas Pfenniger
committed
Fixed change of request uri.path -> url
1 parent 0c4dcfe commit f3f25a2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

example/chat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ chat.addListener("message", function(msg, conn) {
2626
});
2727

2828
function handler(req, res) {
29-
sys.debug(req.method + ' ' + req.uri.path);
29+
sys.debug(req.method + ' ' + req.url);
3030
if (ws.askUpgrade(req)) {
3131
sys.debug("Upgrading to WebSocket");
3232
chat.connect(req, res);
3333
} else {
34-
var filePath = publicDir + req.uri.path;
34+
var filePath = publicDir + req.url;
3535
sendFile(req, res, filePath);
3636
}
3737
}

example/ping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function handler(req, res) {
2626
sys.debug("Closing WebSocket");
2727
});
2828
} else {
29-
var filePath = publicDir + req.uri.path;
29+
var filePath = publicDir + req.url;
3030
sendFile(req, res, filePath);
3131
}
3232
}

example/shared.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const mimeMap = {
1111

1212

1313
function notFound(req, res) {
14-
var msg = "<h1>File not found : " + req.uri.path + "</h1>";
14+
var msg = "<h1>File not found : " + req.url + "</h1>";
1515
res.sendHeader(404, {
1616
"Content-Type": "text/html",
1717
"Content-Length": msg.length

lib/http/websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function Connection(request, response) {
5454
"Connection": "Upgrade",
5555
"WebSocket-Origin": request.headers.origin,
5656
// TODO: wss://
57-
"WebSocket-Location": "ws://" + request.headers.host + request.uri.path
57+
"WebSocket-Location": "ws://" + request.headers.host + request.url
5858
});
5959
response.flush(); // send!!
6060
}

0 commit comments

Comments
 (0)