[tor-bugs] #7110 [Flashproxy]: Do real parsing of boolean query string parameters
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Tue Oct 16 02:24:44 UTC 2012
#7110: Do real parsing of boolean query string parameters
------------------------+---------------------------------------------------
Reporter: dcf | Owner: dcf
Type: defect | Status: new
Priority: minor | Milestone:
Component: Flashproxy | Version:
Keywords: | Parent:
Points: | Actualpoints:
------------------------+---------------------------------------------------
Comment(by dcf):
Thank you for making these changes. It's easier if you attach patches
instead; use
{{{
git format-patch HEAD^
}}}
or something similar.
`get_query_string_param_boolean` should work the same way and have the
same signature as the other `get_query_string_param_*` functions. That is,
it shouldn't just take a single value; it should take a query string, a
parameter name, and a default value.
In other words, the test for the debug parameter should look something
like this:
{{{
var query = parse_query_string(window.location.search.substr(1));
var DEBUG = get_query_string_param_boolean(query, "debug", false);
if (DEBUG) {
....
}
}}}
The `switch` you have written would be shorter (6 lines) and clearer as an
`if`-`else`.
`test_get_query_string_param_boolean` looks good, but the test cases
should use query strings to match the expected behavior of
`get_query_string_param_boolean` as described above.
There are some places in the patch that add blank lines; avoid making
these kinds of unrelated changes. Try `git checkout -p` to selectively
discard parts of your changes.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7110#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list