summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-02-01 17:17:46 +0000
committerhallgren <hallgren@chalmers.se>2012-02-01 17:17:46 +0000
commit3cbad333ade5db4cb3033e7800170229feeb12ae (patch)
treebfe9cdff530224d0b7595ee6c9230bec86740113
parentdebb9da44dc12f6a507e6a9043d4078f381cecd2 (diff)
gf -server: fix bug that caused '+' to be converted to ' ' in uploaded grammars
Fixed buggy workaround for bug in httpd-shed function queryToArguments.
-rw-r--r--src/compiler/GFServer.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/compiler/GFServer.hs b/src/compiler/GFServer.hs
index b19b92512..029df096d 100644
--- a/src/compiler/GFServer.hs
+++ b/src/compiler/GFServer.hs
@@ -90,10 +90,9 @@ handle_fcgi execute1 state0 stateM cache =
-- | HTTP request handler
handle state0 cache execute1
rq@(Request method URI{uriPath=upath,uriQuery=q} hdrs body) state =
- do let qs = decodeQ $
- case method of
- "GET" -> queryToArguments q
- "POST" -> queryToArguments body
+ do let qs = case method of
+ "GET" -> inputs q
+ "POST" -> inputs body
logPutStrLn $ method++" "++upath++" "++show qs
case upath of
@@ -338,9 +337,11 @@ toHeader s = FCGI.HttpExtensionHeader s -- cheating a bit
-}
-- * misc utils
-decodeQ qs = [(decode n,decode v)|(n,v)<-qs]
-decode = map decode1
-decode1 '+' = ' ' -- httpd-shed bug workaround
-decode1 c = c
+
+inputs = queryToArguments . fixplus
+ where
+ fixplus = concatMap decode
+ decode '+' = "%20" -- httpd-shed bug workaround
+ decode c = [c]
mapFst f xys = [(f x,y)|(x,y)<-xys] \ No newline at end of file