The server normally returns a 404 response if an unknown URI is requested,
but it also returns a lame empty message. This lets you do a 404 response
with a custom message for special URIs.
Public Class Methods
new(msg)click to toggle source
Sets the message to return. This is constructed once for the handler so
it’s pretty efficient.
# File lib/mongrel/handlers.rb, line 80definitialize(msg)
@response = Const::ERROR_404_RESPONSE+msgend
Public Instance Methods
process(request, response)click to toggle source
Just kicks back the standard 404 response with your special message.
# File lib/mongrel/handlers.rb, line 85defprocess(request, response)
response.socket.write(@response)
end