diff options
author | Hans de Graaff <hans@degraaff.org> | 2014-08-22 17:50:06 +0200 |
---|---|---|
committer | Hans de Graaff <hans@degraaff.org> | 2014-08-22 17:50:06 +0200 |
commit | d69914f1bcda4d9f09c96167b378f7ccd842ccb7 (patch) | |
tree | 89a08ae4e38ebb46ba4f56635da1eb48e7944559 /lib/gorg | |
parent | Document release date and version. (diff) | |
download | gorg-d69914f1bcda4d9f09c96167b378f7ccd842ccb7.tar.gz gorg-d69914f1bcda4d9f09c96167b378f7ccd842ccb7.tar.bz2 gorg-d69914f1bcda4d9f09c96167b378f7ccd842ccb7.zip |
Fix compatibility with fcgi 0.9.
Diffstat (limited to 'lib/gorg')
-rw-r--r-- | lib/gorg/cgi.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gorg/cgi.rb b/lib/gorg/cgi.rb index dfe8451..b6dca40 100644 --- a/lib/gorg/cgi.rb +++ b/lib/gorg/cgi.rb @@ -59,7 +59,17 @@ module Gorg path_info = cgi.env_table['SCRIPT_NAME'] end query = Hash.new - cgi.params.each{ |p, v| query[p] = v.to_s} + cgi.params.each do |p, v| + # fcgi 0.9 always provides an Array even with one + # argument. Gorg only handles one argument, as far as I can + # tell, so we take the first value in that case. + value = if v.class == Array + v.first + else + v + end + query[p] = value.to_s + end # Get DOCUMENT_ROOT from environment $Config["root"] = cgi.env_table['DOCUMENT_ROOT'] |