Permalink
Browse files

Use fullpath if request_uri is not available

  • Loading branch information...
1 parent be6a753 commit 1bff5edb5faa7b0656dc577e8930be54c9ea545d @mnylen committed Oct 4, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/failurous/rails/fail_notification.rb
@@ -12,8 +12,14 @@ def fill_from_controller(controller)
self.location = "#{controller.controller_name}##{controller.action_name}"
request = controller.request
+ request_uri = if request.respond_to?(:request_uri)
+ request.request_uri
+ else
+ request.fullpath
+ end
+
self.add_field(:request, :REQUEST_METHOD, request.method, {:humanize_field_name => false}).
- add_field(:request, :REQUEST_URI, request.request_uri, {:humanize_field_name => false}).
+ add_field(:request, :REQUEST_URI, request_uri, {:humanize_field_name => false}).
add_field(:request, :REMOTE_ADDR, request.remote_ip, {:humanize_field_name => false}).
add_field(:request, :HTTP_USER_AGENT, request.headers["User-Agent"], {:humanize_field_name => false}).
add_field(:summary, :params, controller.params)

0 comments on commit 1bff5ed

Please sign in to comment.