Skip to content

Commit f3bafda

Browse files
committed
url: handle literal urls with =s in their query param values
1 parent 7ad64d7 commit f3bafda

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

http-easy-lib/http-easy/private/url.rkt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@
5656
[(list name value)
5757
(cons (string->symbol name) value)]
5858
[(list name)
59-
(cons (string->symbol name) #f)]))
59+
(cons (string->symbol name) #f)]
60+
[(list name value ...) ;; noqa
61+
(cons (string->symbol name)
62+
(string-join value "="))]))
6063
null)])
6164
(url/literal scheme user host port abs? path query fragment)))
6265

@@ -129,7 +132,7 @@
129132
(or (and (> num-%-matches 0)
130133
(= num-%-matches (length (regexp-match* #px"%[a-fA-F0-9]{2}" s))))
131134
(and (eq? encode form-urlencoded-encode)
132-
(regexp-match? #rx"[+]" s))))
135+
(regexp-match? #rx"[+=]" s))))
133136

134137
(define (ipv6-host? s)
135138
(regexp-match? #rx"^[0-9a-fA-F:]*:[0-9a-fA-F:]*$" s))

http-easy-lib/info.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#lang info
22

33
(define license 'BSD-3-Clause)
4-
(define version "0.8.4")
4+
(define version "0.8.5")
55
(define collection "net")
66
(define deps
77
'(["base" #:version "8.1.0.4"]

http-easy-test/net/http-easy/private/url.rkt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
("http://example.com/a%2Bb.mp3" . "http://example.com/a%2Bb.mp3")
6868
("http://example.com/a%2Bb.mp3?c=d+e" . "http://example.com/a%2Bb.mp3?c=d+e")
6969
("http://example.com/a%2Bb.mp3?c=d+e&f&g=h" . "http://example.com/a%2Bb.mp3?c=d+e&f&g=h")
70+
("https://yleawsaudioipv4.akamaized.net/download/world/78-e0812afa331548619c40a31f60a2d6c3/audio-1742305456621.mp3/filename/Nyhetspodden-Alla-vill-ha-Gronland--men-vad-vill-gronlanningarna-sjalva-2025-03-19.mp3?hdnts=exp=1742456407~acl=/download/world/78-e0812afa331548619c40a31f60a2d6c3/audio-1742305456621.mp3/filename/Nyhetspodden-Alla-vill-ha-Gronland--men-vad-vill-gronlanningarna-sjalva-2025-03-19.mp3~hmac=4cf1fae52a5f2aea1a12f2d677c364668a893b311a4ed761d9d7c259b229841a"
71+
. "https://yleawsaudioipv4.akamaized.net/download/world/78-e0812afa331548619c40a31f60a2d6c3/audio-1742305456621.mp3/filename/Nyhetspodden-Alla-vill-ha-Gronland--men-vad-vill-gronlanningarna-sjalva-2025-03-19.mp3?hdnts=exp=1742456407~acl=/download/world/78-e0812afa331548619c40a31f60a2d6c3/audio-1742305456621.mp3/filename/Nyhetspodden-Alla-vill-ha-Gronland--men-vad-vill-gronlanningarna-sjalva-2025-03-19.mp3~hmac=4cf1fae52a5f2aea1a12f2d677c364668a893b311a4ed761d9d7c259b229841a")
7072
("a/b/c" . "a/b/c")
7173
("/a/b/c" . "/a/b/c")
7274
("/a;b;c" . "/a;b;c")))

0 commit comments

Comments
 (0)