pgf-http: fix a bug that caused "+" to be treaded as " " in PGF service requests URLs.

This was a bug in my workaround for a bug in the httpd-shed package. It
made it impossible to use the glue token "&+" for Turkish input in the minibar,
for example.
This commit is contained in:
hallgren
2011-08-25 16:58:17 +00:00
parent 6757ab2b41
commit 623c72ca1d

View File

@@ -36,10 +36,13 @@ cgiReq root (Request method uri hdrs body) = CGIRequest vars inputs body'
'?':s -> s
s -> s
al = maybe "" id $ lookup "Accept-Language" hdrs
inputs = map input $ queryToArguments qs -- assumes method=="GET"
inputs = map input $ queryToArguments $ fixplus qs -- assumes method=="GET"
body' = BS.pack body
input (name,val) = (name,Input (BS.pack (map decode val)) Nothing plaintext)
input (name,val) = (name,Input (BS.pack val) Nothing plaintext)
plaintext = ContentType "text" "plain" []
decode '+' = ' ' -- httpd-shed bug workaround
decode c = c
fixplus = concatMap decode
where
decode '+' = "%20" -- httpd-shed bug workaround
decode c = [c]