[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [onionoo/master] Make more parameter names case-insensitive.



commit 91cfd08df1bfa34ae8c64113ceb7248df0a85d9b
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Thu Apr 25 15:22:04 2013 +0200

    Make more parameter names case-insensitive.
---
 src/org/torproject/onionoo/ResourceServlet.java |    7 ++++---
 web/index.html                                  |    3 +++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/org/torproject/onionoo/ResourceServlet.java b/src/org/torproject/onionoo/ResourceServlet.java
index f36a377..0588ef5 100644
--- a/src/org/torproject/onionoo/ResourceServlet.java
+++ b/src/org/torproject/onionoo/ResourceServlet.java
@@ -294,7 +294,7 @@ public class ResourceServlet extends HttpServlet {
     Map<String, String> filteredBridges = new HashMap<String, String>(
         this.bridgeFingerprintSummaryLines);
     if (parameterMap.containsKey("type")) {
-      String typeParameterValue = parameterMap.get("type");
+      String typeParameterValue = parameterMap.get("type").toLowerCase();
       boolean relaysRequested = true;
       if (typeParameterValue.equals("bridge")) {
         relaysRequested = false;
@@ -305,7 +305,8 @@ public class ResourceServlet extends HttpServlet {
       this.filterByType(filteredRelays, filteredBridges, relaysRequested);
     }
     if (parameterMap.containsKey("running")) {
-      String runningParameterValue = parameterMap.get("running");
+      String runningParameterValue =
+          parameterMap.get("running").toLowerCase();
       boolean runningRequested = true;
       if (runningParameterValue.equals("false")) {
         runningRequested = false;
@@ -395,7 +396,7 @@ public class ResourceServlet extends HttpServlet {
     List<String> orderedRelays = new ArrayList<String>();
     List<String> orderedBridges = new ArrayList<String>();
     if (parameterMap.containsKey("order")) {
-      String orderParameter = parameterMap.get("order");
+      String orderParameter = parameterMap.get("order").toLowerCase();
       boolean descending = false;
       if (orderParameter.startsWith("-")) {
         descending = true;
diff --git a/web/index.html b/web/index.html
index e8df242..b726bd2 100755
--- a/web/index.html
+++ b/web/index.html
@@ -629,10 +629,12 @@ parameter value is considered.
 <tr><td><b>type</b></td><td>Return only relay (parameter value
 <b>relay</b>) or only bridge documents (parameter value
 <b>bridge</b>).
+Parameter values are case-insensitive.
 </td></tr>
 <tr><td><b>running</b></td><td>Return only running (parameter value
 <b>true</b>) or only non-running relays and/or bridges (paramter value
 <b>false</b>).
+Parameter values are case-insensitive.
 </td></tr>
 <tr><td><b>search</b></td><td>Return only relays with the parameter value
 matching (part of a) nickname, (possibly $-prefixed) beginning of a
@@ -712,6 +714,7 @@ of fields in ascending or descening order.
 Results are first ordered by the first list element, then by the second,
 and so on.
 Possible fields for ordering are: <b>consensus_weight</b>.
+Field names are case-insensitive.
 Ascending order is the default; descending order is selected by prepending
 fields with a minus sign (<b>-</b>).
 Relays or bridges which don't have any value for a field to be ordered by

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits