forked from svrjs/svrjs
Replace (...).indexOf("/") != 0 with (...)[0] != "/"
This commit is contained in:
parent
70cb113715
commit
1ae35a1977
1 changed files with 2 additions and 2 deletions
4
svr.js
4
svr.js
|
@ -2984,7 +2984,7 @@ if (!cluster.isPrimary) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var isProxy = false;
|
var isProxy = false;
|
||||||
if (req.url.indexOf("/") != 0 && req.url != "*") isProxy = true;
|
if (req.url[0] != "/" && req.url != "*") isProxy = true;
|
||||||
serverconsole.locmessage("Somebody connected to " + (secure && fromMain ? ((typeof sport == "number" ? "port " : "socket ") + sport) : ((typeof port == "number" ? "port " : "socket ") + port)) + "...");
|
serverconsole.locmessage("Somebody connected to " + (secure && fromMain ? ((typeof sport == "number" ? "port " : "socket ") + sport) : ((typeof port == "number" ? "port " : "socket ") + port)) + "...");
|
||||||
|
|
||||||
if (req.socket == null) {
|
if (req.socket == null) {
|
||||||
|
@ -3314,7 +3314,7 @@ if (!cluster.isPrimary) {
|
||||||
if (uobject.href != "") nuobject.href = uobject.href;
|
if (uobject.href != "") nuobject.href = uobject.href;
|
||||||
|
|
||||||
// Adjust the pathname and href properties if the URI doesn't start with "/"
|
// Adjust the pathname and href properties if the URI doesn't start with "/"
|
||||||
if (preparedURI.indexOf("/") != 0) {
|
if (preparedURI[0] != "/") {
|
||||||
if (nuobject.pathname) {
|
if (nuobject.pathname) {
|
||||||
nuobject.pathname = nuobject.pathname.substring(1);
|
nuobject.pathname = nuobject.pathname.substring(1);
|
||||||
nuobject.href = nuobject.pathname + (nuobject.search ? nuobject.search : "");
|
nuobject.href = nuobject.pathname + (nuobject.search ? nuobject.search : "");
|
||||||
|
|
Reference in a new issue