re PR libgcj/14009 (libgcj HttpURLConnection does not handle situation where retrieving url without trailing slash after domain.)

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
This commit is contained in:
Michael Koch 2004-10-22 20:23:21 +00:00 committed by Michael Koch
parent eb84665417
commit 7758f90a45
2 changed files with 10 additions and 2 deletions

View 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,

View 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)