Skip to content

Commit d9e52c6

Browse files
committed
FIX: HTTP query validation fixed
related to: Oldes/Rebol-issues#2606
1 parent 2749235 commit d9e52c6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/mezz/prot-http.reb

+3-3
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ escape-query: function/with [
260260
][
261261
parse query [some [
262262
some allowed
263-
| #"%" 2 numeric ;; already escaped
263+
| #"%" 2 hex ;; already escaped
264264
| change #" " #"+"
265265
| change set c: skip (ajoin [#"%" enbase to binary! c 16])
266266
]]
267267
query
268268
][
269-
numeric: system/catalog/bitsets/numeric
270-
allowed: charset [#"a"-#"z" #"A"-#"Z" #"0"-#"9" "-~!@*/|\;,._()[]{}+=?~"]
269+
hex: system/catalog/bitsets/hex-digits
270+
allowed: charset [#"a"-#"z" #"A"-#"Z" #"0"-#"9" "-~!@*/|\;,._()[]{}+=?~&"]
271271
]
272272

273273
make-http-request: func [

src/tests/units/port-http-test.r3

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ system/schemes/http/spec/timeout: 30
130130
--test-- "query with a space"
131131
;@@ https://github.com/Oldes/Rebol-issues/issues/2606
132132
--assert all [ ;= OK
133-
block? res: try [read/all append http://httpbin.org/get?q= "Some query"]
133+
block? res: try [read/all append http://httpbin.org/get? "q=Some query&v=[]"]
134134
res/1 = 200
135135
map? try [data: decode 'json res/3]
136136
data/args/q == "Some query"
137+
data/args/v == "[]"
137138
]
138139
===end-group===
139140

0 commit comments

Comments
 (0)