Strange behavior with content-type text/plain while POST files

Florian Krupicka <[email protected]> Mon, 16 Aug 2004 23:02:47 +0200
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Hi,
I ran into something strange the last days. I was building a wrapper
class for my access to modrubys query variables, when i discovered
the following during testing.

When i deliver text/plain back to the browser (i do so while testing my
classes for easy and fast debug output) and the request-type is a POST
then modruby/apache delivers the text-output "binary", that is the
browser wants to download the incoming data instead of putting it on
screen directly. For GET-type requests everything is delivered as
expected. Its also no difference between x-www-form-urlencoded and
multipart POSTs. Same bug.

It seems to be no problem with content-type set to text/html, but i am
still wondering.

Here is what my test.rbx that just iterates over the data looks like

===
require 'request.rb'

apreq = Apache::request
apreq.content_type = 'text/plain'

req = Web::Request.new

puts "Request-Test - I'ts #{Time.now.to_s}\n"

puts "#{apreq.content_type}\n"
puts "#{apreq.inspect}\n\n"

puts "### GET-DATA\n"

req.get.each do |key, value|
  puts "#{key} => #{value} (#{value.class})\n"
end

puts "### COOKIE-DATA\n"
[...]
===

request.rb with Web::Request class is to be found here:
http://nopaste.php.cd/25931

Hope someone can help me fix this
Greets Florian