On Fri, 3 Aug 2001, Aristarkh A Zagorodnikov wrote:

> So I recommend the following (which is still not correct - the only real way
> to get a request method is having the server tell it to you):
> the_method = ENV['CONTENT_LENGTH'].to_s.to_i.zero? ? 'GET' : 'POST'

Yeah, I knew the original wasn't correct. I added in support to give a meaningful error if the query on a POST was vital data. If it's non-vital and it gets called that way, that which is not read is simply dropped. There's a note saying "POST with query is not supported at this time. Just deal. Call this as documented." ;) The script isn't overly complex. Just lots of redundant code. I'm using it as a way to prove that Ruby can create more compact, more legible CGIs. It's proof to myself, mainly. Especially since teh optimized code in Perl is around 300 lines. Ugh. It looks like it's going to stay around 150 in Ruby. And who knows? Maybe in 3 months, I'll know enough to get it down to 50.

I'll include this suggestion as it IS slightly more correct. But until my Apache issues get ironed out, I'll live. The "correct way" is in a comment just waiting...

--Matt