summaryrefslogtreecommitdiff
path: root/src/server/RunHTTP.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2011-08-25 16:58:17 +0000
committerhallgren <hallgren@chalmers.se>2011-08-25 16:58:17 +0000
commit623c72ca1dd60c7e9a3b92bcfda873e42eb04adc (patch)
tree92726f7fbdbb6db55852430598ec85b33c2c78c8 /src/server/RunHTTP.hs
parent6757ab2b41a9dc6c74f6184b8d0846970753e9fc (diff)
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.
Diffstat (limited to 'src/server/RunHTTP.hs')
-rw-r--r--src/server/RunHTTP.hs11
1 files 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]