[tor-commits] [flashproxy/master] Break up the cookie disable logic.
dcf at torproject.org
dcf at torproject.org
Fri Dec 28 14:13:54 UTC 2012
commit 6d6505aa84583806bb5cedfbe51430cc8079c272
Author: David Fifield <david at bamsoftware.com>
Date: Tue Dec 25 13:38:39 2012 -0800
Break up the cookie disable logic.
---
proxy/flashproxy.js | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/proxy/flashproxy.js b/proxy/flashproxy.js
index 4aecc8c..795dac1 100644
--- a/proxy/flashproxy.js
+++ b/proxy/flashproxy.js
@@ -942,11 +942,15 @@ function flashproxy_should_disable() {
return true;
}
- var setting = get_param_boolean(cookies, OPT_IN_COOKIE, undefined);
- var opt_in = get_param_boolean(query, "cookierequired", false);
- if (setting === undefined && opt_in || setting === false) {
- /* User has opted-out, or opt-in is required and cookie is missing. */
- puts("Disable because of opt-out or required opt-in.");
+ var flashproxy_allow = get_param_boolean(cookies, OPT_IN_COOKIE);
+ var cookierequired = get_param_boolean(query, "cookierequired", false);
+ /* flashproxy_allow may be true, false, or undefined. If undefined, only
+ disable if the cookierequired param is also set. */
+ if (flashproxy_allow === false) {
+ puts("Disable because of cookie opt-out.");
+ return true;
+ } else if (cookierequired && !flashproxy_allow) {
+ puts("Disable because of cookie required and no opt-in.");
return true;
}
More information about the tor-commits
mailing list