]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix bugs with browser responder.
authorChris Double <chris.double@double.co.nz>
Sun, 13 Feb 2005 02:51:33 +0000 (02:51 +0000)
committerChris Double <chris.double@double.co.nz>
Sun, 13 Feb 2005 02:51:33 +0000 (02:51 +0000)
Fix url>path so it doesn't double decode query parameters.

library/httpd/httpd.factor

index c4faf202dad2d725467ecb1ea50d112caa1ba5f9..2f2921a1b35170aba728685ac5f1ed00e1e3da45 100644 (file)
@@ -12,11 +12,18 @@ stdio streams strings threads url-encoding ;
         drop stdio get
     ] ifte ;
 
-: url>path ( uri -- path )
+: (url>path) ( uri -- path )
     url-decode "http://" ?str-head [
         "/" split1 dup "" ? nip
     ] when ;
 
+: url>path ( uri -- path )
+    "?" split1 dup [
+      >r (url>path) "?" r> cat3
+    ] [
+      drop (url>path)
+    ] ifte ;
+
 : secure-path ( path -- path )
     ".." over str-contains? [ drop f ] when ;