Skip to content

Commit c7db449

Browse files
authored
Merge pull request #36 from slamdata/encode-equals
Encode = in query keys and values
2 parents 674788d + a583005 commit c7db449

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Data/URI/Query.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ printQueryPart = S.joinWith "" <<< map printChar <<< S.split (S.Pattern "")
7070
| otherwise = encodeURIComponent s
7171

7272
rxPrintable RX.Regex
73-
rxPrintable = unsafePartial fromRight $ RX.regex "[$+=/?:@]" RXF.global
73+
rxPrintable = unsafePartial fromRight $ RX.regex "[$+/?:@]" RXF.global

test/Main.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ main = runTest $ suite "Data.URI" do
475475
testPrintQuerySerializes
476476
(Query (Tuple "key1" (Just "value1") : Tuple "key2" (Just "value2") : Tuple "key1" (Just "value3") : Nil))
477477
"?key1=value1&key2=value2&key1=value3"
478+
testPrintQuerySerializes
479+
(Query (Tuple "k=ey" (Just "value=1") : Nil))
480+
"?k%3Dey=value%3D1"
478481
testPrintQuerySerializes (Query Nil) "?"
479482
testPrintQuerySerializes
480483
(Query (Tuple "key1" (Just "") : Tuple "key2" (Just "") : Nil))

0 commit comments

Comments
 (0)