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

**URL:** <https://www.ruby-forum.com/t/bug-in-webrick-campinghandler-typo-in-the-code/108652>\
**Category:** Ruby\
**Created:** [July 5, 2007, 5:51pm UTC](https://www.ruby-forum.com/t/bug-in-webrick-campinghandler-typo-in-the-code/108652 "2007-07-05T17:51:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vassilis\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/848f3c/32.png) [@Vassilis\_R](https://www.ruby-forum.com/u/Vassilis_R)\
**Post date:** [July 5, 2007, 5:51pm UTC](https://www.ruby-forum.com/t/bug-in-webrick-campinghandler-typo-in-the-code/108652/1 "2007-07-05T17:51:40Z")

</div>

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

- → /  
[2007-07-05 17:33:44] ERROR NameError: undefined local variable or  
method `res’ for #WEBrick::CampingHandler:0x262a1f4

/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:in `service’  
/opt/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /opt/local/lib/ruby/1.8/webrick/server.rb:173:in `start\_thread’  
/opt/local/lib/ruby/1.8/webrick/server.rb:162:in `start' /opt/local/lib/ruby/1.8/webrick/server.rb:162:in `start\_thread’  
/opt/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /opt/local/lib/ruby/1.8/webrick/server.rb:92:in `each’  
/opt/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /opt/local/lib/ruby/1.8/webrick/server.rb:23:in `start’  
/opt/local/lib/ruby/1.8/webrick/server.rb:82:in `start' ./lib/rutemaweb/rutemaweb.rb:247:in `start\_server’  
bin/rutemaweb:9  
localhost - - [05/Jul/2007:17:33:44 CEST] “GET /style.css HTTP/1.1” 500  
367  
[http://localhost:3301/](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.-

---

<div class="post-metadata">

**Author:** ![Vassilis\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/848f3c/32.png) [@Vassilis\_R](https://www.ruby-forum.com/u/Vassilis_R)\
**Post date:** [July 5, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/bug-in-webrick-campinghandler-typo-in-the-code/108652/2 "2007-07-05T18:00:41Z")

</div>

On 7/5/07, Vassilis R. [removed\_email\_address@domain.invalid](mailto: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](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/](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
