Skip to content
Browse files

Added Rack::Request#path

I would imagine since its used internally there is a chance other devs will
need it, and IMO its a mise-well situation, your call :)

Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com>
  • Loading branch information...
1 parent 939fa7d commit 3a544a7a4e6236e9c1271d88e580e7d42bc110fc @tj tj committed with chneukirchen Mar 18, 2009
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/rack/request.rb
View
10 lib/rack/request.rb
@@ -211,11 +211,13 @@ def url
url
end
-
+
+ def path
+ script_name + path_info
+ end
+
def fullpath
- path = script_name + path_info
- path << "?" << query_string unless query_string.empty?
- path
+ query_string.empty? ? path : "#{path}?#{query_string}"
end
def accept_encoding

0 comments on commit 3a544a7

Please sign in to comment.
Something went wrong with that request. Please try again.