V
Vassilis Rizopoulos
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.newPort => port, ocumentRoot => 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/ -> /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.-
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.newPort => port, ocumentRoot => 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/ -> /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.-