1
0
forked from GitHub/gf-core

pgf-server HTTP mode: workaround for bugs in the httpd-shed package that prevented the fridge and translate web apps from working

queryToArguments "?&input=bla+bla"
           returns [("&input","bla+bla")]
 but should return [("input","bla bla")]
This commit is contained in:
hallgren
2010-09-03 13:12:08 +00:00
parent 9fc58ce0e7
commit 5b09b82f31

View File

@@ -31,11 +31,13 @@ cgiReq (Request method uri hdrs body) = CGIRequest vars inputs body'
("SCRIPT_FILENAME",documentRoot++uriPath uri),
("QUERY_STRING",qs)]
qs = case uriQuery uri of
'?':'&':s -> s -- httpd-shed bug workaround
'?':s -> s
s -> s
inputs = map input $ queryToArguments qs -- assumes method=="GET"
body' = BS.pack body
input (name,val) = (name,Input (BS.pack val) Nothing plaintext)
plaintext = ContentType "plain" "text" []
input (name,val) = (name,Input (BS.pack (map decode val)) Nothing plaintext)
plaintext = ContentType "text" "plain" []
decode '+' = ' ' -- httpd-shed bug workaround
decode c = c