[tor-commits] [flashproxy/master] Use JavaScript trim method, and trim both name and value.

dcf at torproject.org dcf at torproject.org
Fri Dec 28 14:13:54 UTC 2012


commit 5406ca86487f351efbfff6c11d6d90ac0dafa924
Author: David Fifield <david at bamsoftware.com>
Date:   Mon Dec 24 18:02:56 2012 -0800

    Use JavaScript trim method, and trim both name and value.
---
 proxy/flashproxy.js |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/proxy/flashproxy.js b/proxy/flashproxy.js
index 777fb0d..86ecfab 100644
--- a/proxy/flashproxy.js
+++ b/proxy/flashproxy.js
@@ -118,11 +118,8 @@ function parse_cookie_string(cookies) {
         if (j === -1) {
             return null;
         }
-        name = string.substr(0, j);
-        value = string.substr(j + 1);
-
-        while (name[0] === " ")
-            name = name.substr(1);
+        name = string.substr(0, j).trim();
+        value = string.substr(j + 1).trim();
 
         result[name] = value;
     }





More information about the tor-commits mailing list