summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-22 20:23:21 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-22 20:23:21 +0000
commitee517115054cd351574b663107e0b0e7c0103c3e (patch)
treefd0e77c631e441dcc20c4b2428f8e3e1e3df9184
parent00d6ff75338a72decbb928a2a774058bcd9d2d7e (diff)
downloadgcc-ee517115054cd351574b663107e0b0e7c0103c3e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89476 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/gnu/java/net/protocol/http/Connection.java6
2 files changed, 10 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ecfbfcbc523..c8ba2853db9 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,11 @@
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,
java/lang/StackTraceElement.java,
java/nio/Buffer.java,
diff --git a/libjava/gnu/java/net/protocol/http/Connection.java b/libjava/gnu/java/net/protocol/http/Connection.java
index 2894e05cc7b..d5ac5fbac3e 100644
--- a/libjava/gnu/java/net/protocol/http/Connection.java
+++ b/libjava/gnu/java/net/protocol/http/Connection.java
@@ -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)