From 623c72ca1dd60c7e9a3b92bcfda873e42eb04adc Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 25 Aug 2011 16:58:17 +0000 Subject: [PATCH] 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. --- src/server/RunHTTP.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/server/RunHTTP.hs b/src/server/RunHTTP.hs index 95c6ac2f2..0047d68a3 100644 --- a/src/server/RunHTTP.hs +++ b/src/server/RunHTTP.hs @@ -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]