summaryrefslogtreecommitdiff
path: root/lib/uri/http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri/http.rb')
-rw-r--r--lib/uri/http.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/uri/http.rb b/lib/uri/http.rb
index 9877b1ee59..dc47613cdf 100644
--- a/lib/uri/http.rb
+++ b/lib/uri/http.rb
@@ -93,12 +93,12 @@ module URI
# Otherwise, the path is simply URI#path.
#
def request_uri
- r = path_query
- if r && r[0] != ?/
- r = '/' + r
+ return nil unless @path
+ if @path.start_with?(?/.freeze)
+ @query ? "#@path?#@query" : @path.dup
+ else
+ @query ? "/#@path?#@query" : "/#@path"
end
-
- r
end
end