diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2011-12-20 20:34:04 +0100 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-01-10 04:39:53 +0100 |
commit | 79b12a0ffbffc05186d489e0f553aa8f2a50d5b7 (patch) | |
tree | c833eee29b7627c7d94d5ee9d118b7809b411b83 /actionpack/lib/action_dispatch | |
parent | 63305daeba3d85442b3a84d4df0c83f59250c7cb (diff) | |
download | rails-79b12a0ffbffc05186d489e0f553aa8f2a50d5b7.tar.gz rails-79b12a0ffbffc05186d489e0f553aa8f2a50d5b7.tar.bz2 rails-79b12a0ffbffc05186d489e0f553aa8f2a50d5b7.zip |
Add original_fullpath and original_url methods to Request
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index c5c48ec489..820921252d 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -122,10 +122,18 @@ module ActionDispatch Http::Headers.new(@env) end + def original_fullpath + @original_fullpath ||= (env["ORIGINAL_FULLPATH"] || fullpath) + end + def fullpath @fullpath ||= super end + def original_url + base_url + original_fullpath + end + def media_type content_mime_type.to_s end |