Skip to content

Commit

Permalink
chore: fix eslint dismatch rules
Browse files Browse the repository at this point in the history
  • Loading branch information
timcui authored and huangyoukun committed May 25, 2018
1 parent 00fde12 commit 6eaff2b
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 149 deletions.
2 changes: 1 addition & 1 deletion bin/proxy/http.proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function requestHandler(req, res) {
cleanCache();
}

if('upgrade' === req.headers.connection && 'websocket' === req.headers.upgrade) {
if(req.headers.connection === 'upgrade' && req.headers.upgrade === 'websocket') {
//websocket
return;
}
Expand Down
12 changes: 6 additions & 6 deletions bin/proxy/ws.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ exports.doRoute = function(ws, type, d1, d2) {
}
if (typeof moduleObj.onConnection != 'function') {
moduleObj.onConnection = function(ws) {
1 == ws.readyState && ws.send('no onConnection funtion,so go default');
ws.readyState === 1 && ws.send('no onConnection funtion,so go default');
};
}
if (typeof moduleObj.onMessage != 'function') {
moduleObj.onMessage = function(ws, data) {
1 == ws.readyState && ws.send('no onMessage function,so go default,ws server get message:' + data);
ws.readyState === 1 && ws.send('no onMessage function,so go default,ws server get message:' + data);
};
}
if (typeof moduleObj.onClose != 'function') {
Expand All @@ -43,14 +43,14 @@ exports.doRoute = function(ws, type, d1, d2) {
logger.debug('no onError function, so go default');
};
}
if ('connection' == type) {
if (type === 'connection') {
moduleObj.onConnection(ws);
} else if ('message' == type) {
} else if (type === 'message') {
contextMod.currentContext().mod_act = mod_act;
moduleObj.onMessage(ws, d1);
} else if ('close' == type) {
} else if (type === 'close') {
moduleObj.onClose(ws, d1, d2);
} else if ('error' == type) {
} else if (type === 'error') {
moduleObj.onError(ws, d1);
}
};
Loading

0 comments on commit 6eaff2b

Please sign in to comment.