Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit cd76a3b

Browse files
committed
this fixes #33
1 parent 74e50f8 commit cd76a3b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

js/lists.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ function evaluate(type, hostname) {
189189
}
190190
// indirect: any type, specific hostname
191191
cellKey = '*/' + hostname;
192-
if ( blacklist[cellKey] || (!graylist[cellKey] && blacklistReadonly[hostname]) ) {
193-
return httpsb.DISALLOWED_INDIRECT;
194-
}
192+
// rhill 2013-10-26: Whitelist MUST be checked before blacklist,
193+
// because read-only blacklists are, hum... read-only?
195194
if ( whitelist[cellKey] ) {
196195
// https://github.com/gorhill/httpswitchboard/issues/29
197196
// The cell is indirectly whitelisted because of hostname, type
@@ -201,6 +200,9 @@ function evaluate(type, hostname) {
201200
}
202201
return httpsb.ALLOWED_INDIRECT;
203202
}
203+
if ( blacklist[cellKey] || (!graylist[cellKey] && blacklistReadonly[hostname]) ) {
204+
return httpsb.DISALLOWED_INDIRECT;
205+
}
204206

205207
// indirect: parent hostname nodes
206208
parent = hostname;
@@ -219,9 +221,8 @@ function evaluate(type, hostname) {
219221
}
220222
// any type, specific parent
221223
cellKey = '*/' + parent;
222-
if ( blacklist[cellKey] || (!graylist[cellKey] && blacklistReadonly[parent]) ) {
223-
return httpsb.DISALLOWED_INDIRECT;
224-
}
224+
// rhill 2013-10-26: Whitelist MUST be checked before blacklist,
225+
// because read-only blacklists are, hum... read-only?
225226
if ( whitelist[cellKey] ) {
226227
// https://github.com/gorhill/httpswitchboard/issues/29
227228
// The cell is indirectly whitelisted because of hostname, type
@@ -231,6 +232,9 @@ function evaluate(type, hostname) {
231232
}
232233
return httpsb.ALLOWED_INDIRECT;
233234
}
235+
if ( blacklist[cellKey] || (!graylist[cellKey] && blacklistReadonly[parent]) ) {
236+
return httpsb.DISALLOWED_INDIRECT;
237+
}
234238
}
235239
// indirect: specific type, any hostname
236240
if ( blacklist[typeKey] ) {

0 commit comments

Comments
 (0)