re PR libgcj/14009 (libgcj HttpURLConnection does not handle situation where retrievi...
authorMichael Koch <konqueror@gmx.de>
Fri, 22 Oct 2004 20:23:21 +0000 (20:23 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Fri, 22 Oct 2004 20:23:21 +0000 (20:23 +0000)
2004-10-22  Michael Koch  <konqueror@gmx.de>

PR libjava/14009
* gnu/java/net/protocol/http/Connection.java
(sendRequest): Handle case when url.getFile() returns an empty string.

From-SVN: r89476

libjava/ChangeLog
libjava/gnu/java/net/protocol/http/Connection.java

index ecfbfcbc523f8e096daa7166f61eea529fd34c8d..c8ba2853db99fe0aa4637a49763f7a58d3d38222 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-22  Michael Koch  <konqueror@gmx.de>
+
+       PR libjava/14009
+       * gnu/java/net/protocol/http/Connection.java
+       (sendRequest): Handle case when url.getFile() returns an empty string.
+
 2004-10-22  Michael Koch  <konqueror@gmx.de>
 
        * java/lang/Math.java,
index 2894e05cc7b2129f488c384fdc3e1f3bb60ef5f6..d5ac5fbac3e83b513a86b39b97adbdbbcf68bfd3 100644 (file)
@@ -217,8 +217,10 @@ public final class Connection extends HttpURLConnection
       new PrintWriter(new OutputStreamWriter(outputStream, "8859_1")); 
     
     // Send request including any request properties that were set.
-    outputWriter.print (getRequestMethod() + " " + url.getFile()
-                        + " HTTP/1.1\r\n");
+    String requestFile = url.getFile();
+    outputWriter.print(getRequestMethod() + " "
+                      + requestFile.length() != 0 ? requestFile : "/";
+                       + " HTTP/1.1\r\n");
 
     // Set additional HTTP headers.
     if (getRequestProperty ("Host") == null)