Bug in Webrick::CampingHandler (typo in the code)


#1

OK, I can’t seem to get ticket creation priviliges in the Trac for
Camping so I’ll post it here for _why to see.

On the occasion of the LRSC Name Picker summary I adapted a bit of the
code to play around with X-Sendfile headers.

In my setup, instead of using CampingServer I use the WEBRick handler:
s = HTTPServer.new(:Port => port, :DocumentRoot => docroot )
s.mount mountpoint, WEBrick::CampingHandler, RutemaWeb

This view:
class StyleSheet < R ‘/style.css’
def get
@headers[‘Content-Type’] = ‘text/css’
@headers[‘X-Sendfile’] = File.join(RutemaWeb::HTDOCS,“style.css”)
end
end

generates the following exception in WEBRick:
localhost - - [05/Jul/2007:17:33:44 CEST] “GET / HTTP/1.1” 200 1223

/opt/local/lib/ruby/gems/1.8/gems/camping-1.5/lib/camping/webrick.rb:59:in
service' /opt/local/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/opt/local/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /opt/local/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/opt/local/lib/ruby/1.8/webrick/server.rb:162:in start' /opt/local/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/opt/local/lib/ruby/1.8/webrick/server.rb:95:in start' /opt/local/lib/ruby/1.8/webrick/server.rb:92:ineach’
/opt/local/lib/ruby/1.8/webrick/server.rb:92:in start' /opt/local/lib/ruby/1.8/webrick/server.rb:23:instart’
/opt/local/lib/ruby/1.8/webrick/server.rb:82:in start' ./lib/rutemaweb/rutemaweb.rb:247:instart_server’
bin/rutemaweb:9
localhost - - [05/Jul/2007:17:33:44 CEST] “GET /style.css HTTP/1.1” 500
367
http://localhost:3301/ -> /style.css

The problem is line 59 in camping/webrick.rb:

-do_GET(req, res)
+do_GET(req, resp)

I’ve got the camping 1.5 gem installed.
Cheers,
V.-


#2

On 7/5/07, Vassilis R. removed_email_address@domain.invalid wrote:

OK, I can’t seem to get ticket creation priviliges in the Trac for
Camping so I’ll post it here for _why to see.

I filed a ticket on your behalf:
http://code.whytheluckystiff.net/camping/ticket/134

To get access to the Trac, you should enter your rubyforge info here:
http://code.whytheluckystiff.net/access/

I can’t remember if it takes some time to process, but then you can
just log in with your RubyForge username and password.

cheers,
-greg