[前][次][番号順一覧][スレッド一覧]

ruby-changes:19860

From: naruse <ko1@a...>
Date: Fri, 3 Jun 2011 09:32:32 +0900 (JST)
Subject: [ruby-changes:19860] naruse:r31907 (trunk): * lib/net/http.rb (URI::HTTP#request_uri): return nil when the uri

naruse	2011-06-03 09:32:25 +0900 (Fri, 03 Jun 2011)

  New Revision: 31907

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31907

  Log:
    * lib/net/http.rb (URI::HTTP#request_uri): return nil when the uri
      is path-rootless form. Bug #4759

  Modified files:
    trunk/ChangeLog
    trunk/lib/uri/http.rb
    trunk/test/uri/test_http.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31906)
+++ ChangeLog	(revision 31907)
@@ -1,7 +1,12 @@
+Fri Jun  3 09:27:31 2011  NARUSE, Yui  <naruse@r...>
+
+	* lib/net/http.rb (URI::HTTP#request_uri): return nil when the uri
+	  is path-rootless form. Bug #4759
+
 Thu Jun  2 23:51:03 2011  James Edward Gray II  <jeg2@r...>
 
-    * lib/csv.rb: Improve the line ending detection algorithm
-      (patch by Alexey).
+	* lib/csv.rb: Improve the line ending detection algorithm
+	  patch by Alexey).
 
 Thu Jun  2 20:05:57 2011  NAKAMURA Usaku  <usa@r...>
 
@@ -439,8 +444,8 @@
 Mon May 23 10:01:02 2011  Martin Bosslet  <Martin.Bosslet@g...>
 
 	* ext/openssl/ossl_asn1.c: Do not parse zero-tagged values as EOC. Do
-	not let current length become negative for infinite length constructed
-	values. Support constructed values of length zero. Added tests.
+	  not let current length become negative for infinite length constructed
+	  values. Support constructed values of length zero. Added tests.
 
 Mon May 23 09:19:53 2011  Eric Hodel  <drbrain@s...>
 
Index: lib/uri/http.rb
===================================================================
--- lib/uri/http.rb	(revision 31906)
+++ lib/uri/http.rb	(revision 31907)
@@ -94,7 +94,7 @@
     #
     def request_uri
       r = path_query
-      if r[0] != ?/
+      if r && r[0] != ?/
         r = '/' + r
       end
 
Index: test/uri/test_http.rb
===================================================================
--- test/uri/test_http.rb	(revision 31906)
+++ test/uri/test_http.rb	(revision 31907)
@@ -47,6 +47,7 @@
     assert_equal('/?abc=def', URI.parse('http://a.b.c/?abc=def').request_uri)
     assert_equal('/',         URI.parse('http://a.b.c').request_uri)
     assert_equal('/?abc=def', URI.parse('http://a.b.c?abc=def').request_uri)
+    assert_equal(nil,         URI.parse('http:foo').request_uri)
   end
 
   def test_select

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]