ci: Add lint rule for mandatory curly braces (#9348)
This commit is contained in:
@@ -24,7 +24,7 @@ const getMountForRequest = function (req) {
|
||||
};
|
||||
|
||||
const getBlockList = (ipRangeList, store) => {
|
||||
if (store.get('blockList')) return store.get('blockList');
|
||||
if (store.get('blockList')) { return store.get('blockList'); }
|
||||
const blockList = new BlockList();
|
||||
ipRangeList.forEach(fullIp => {
|
||||
if (fullIp === '::/0' || fullIp === '::') {
|
||||
@@ -50,9 +50,9 @@ export const checkIp = (ip, ipRangeList, store) => {
|
||||
const incomingIpIsV4 = isIPv4(ip);
|
||||
const blockList = getBlockList(ipRangeList, store);
|
||||
|
||||
if (store.get(ip)) return true;
|
||||
if (store.get('allowAllIpv4') && incomingIpIsV4) return true;
|
||||
if (store.get('allowAllIpv6') && !incomingIpIsV4) return true;
|
||||
if (store.get(ip)) { return true; }
|
||||
if (store.get('allowAllIpv4') && incomingIpIsV4) { return true; }
|
||||
if (store.get('allowAllIpv6') && !incomingIpIsV4) { return true; }
|
||||
const result = blockList.check(ip, incomingIpIsV4 ? 'ipv4' : 'ipv6');
|
||||
|
||||
// If the ip is in the list, we store the result in the store
|
||||
@@ -386,7 +386,7 @@ function getClientIp(req) {
|
||||
}
|
||||
|
||||
function httpAuth(req) {
|
||||
if (!(req.req || req).headers.authorization) return;
|
||||
if (!(req.req || req).headers.authorization) { return; }
|
||||
|
||||
var header = (req.req || req).headers.authorization;
|
||||
var appId, masterKey, javascriptKey;
|
||||
|
||||
Reference in New Issue
Block a user