]> gitweb.factorcode.org Git - factor.git/commitdiff
urls.encoding: preserve order of URL query parameters.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Nov 2015 16:36:56 +0000 (08:36 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Nov 2015 16:36:56 +0000 (08:36 -0800)
basis/urls/encoding/encoding.factor

index f9fa7e7c7b26c71ab69834dabc14ab3e67ce876b..45a7b103b4fc901117997ad81ab3375776f75385 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays ascii assocs combinators combinators.short-circuit
-fry io.encodings.string io.encodings.utf8 kernel make math
-math.parser present sequences splitting strings ;
+fry io.encodings.string io.encodings.utf8 kernel linked-assocs
+make math math.parser present sequences splitting strings ;
 IN: urls.encoding
 
 : url-quotable? ( ch -- ? )
@@ -92,7 +92,7 @@ PRIVATE>
 
 : query>assoc ( query -- assoc )
     dup [
-        "&;" split H{ } clone [
+        "&;" split <linked-hash> [
             [
                 [ "=" split1 [ dup [ query-decode ] when ] bi@ swap ] dip
                 add-query-param