I'm trying to add PUT and DELETE verbs to WEBrick. I don't need them to do anything. They just need to respond with a 200. Below is the script I am running. GET works, but DELETE returns 405 with a "unsupported method DELETE" message. Can anyone tell me what is wrong or missing with this code?
require 'webrick'
module WEBrick
module HTTPServlet
class ProcHandler
alias do_PUT do_GET
alias do_DELETE do_GET
end
end
end
sRoot = "C:\\"
server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => sRoot
trap "INT" do server.shutdown end
server.start