lib/angelo/server.rb in angelo-0.1.21 vs lib/angelo/server.rb in angelo-0.1.22
- old
+ new
@@ -39,9 +39,12 @@
if staticable?(meth) and lp = @base.local_path(request.path)
static! meth, connection, request, lp
else
route! meth, connection, request
end
+ rescue URI::InvalidURIError => e
+ Angelo.log connection, request, nil, :bad_request
+ connection.respond :bad_request, DEFAULT_RESPONSE_HEADERS, e.message
end
def route! meth, connection, request
if @base.routes[meth] and rs = @base.routes[meth][request.path]
responder = rs.dup