From 5b09b82f312044a999d58cf484c59d45e00ad47a Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 3 Sep 2010 13:12:08 +0000 Subject: [PATCH] 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")] --- src/server/RunHTTP.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/RunHTTP.hs b/src/server/RunHTTP.hs index cf536d054..c83f7c0a1 100644 --- a/src/server/RunHTTP.hs +++ b/src/server/RunHTTP.hs @@ -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" [] - \ No newline at end of file + input (name,val) = (name,Input (BS.pack (map decode val)) Nothing plaintext) + plaintext = ContentType "text" "plain" [] + decode '+' = ' ' -- httpd-shed bug workaround + decode c = c