Commit 7758f90a by Michael Koch Committed by Michael Koch

re PR libgcj/14009 (libgcj HttpURLConnection does not handle situation where…

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
parent eb846654
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,
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment