From 7758f90a45f294a73e5f069def44d867cbfa6ec5 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Fri, 22 Oct 2004 20:23:21 +0000 Subject: re PR libgcj/14009 (libgcj HttpURLConnection does not handle situation where retrieving url without trailing slash after domain.) 2004-10-22 Michael Koch 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 | 6 ++++++ libjava/gnu/java/net/protocol/http/Connection.java | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'libjava') diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ecfbfcb..c8ba285 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,11 @@ 2004-10-22 Michael Koch + 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 + * 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 2894e05..d5ac5fb 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) -- cgit v1.1