lib/angelo/responder.rb in angelo-0.1.4 vs lib/angelo/responder.rb in angelo-0.1.5
- old
+ new
@@ -126,8 +126,15 @@
@connection.respond :ok, headers, @body
rescue => e
handle_error e, :internal_server_error, false
end
+ def redirect url
+ Angelo.log @connection, @request, nil, :moved_permanently, 0
+ @connection.respond :moved_permanently, headers(LOCATION_HEADER_KEY => url), ''
+ rescue => e
+ handle_error e, :internal_server_error, false
+ end
+
end
end