Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2031088 | 1.3.1 | Stephen Fitch | P4 | Resolved | Fixed | 1.3.1 |
JDK-2031087 | 1.3.0_02 | Stephen Fitch | P4 | Closed | Fixed | 02 |
This bug is similar to bug 4113495 but the customer is using
setRequestProperty instead and only occurs when redirection
is turned off.
CUSTOMER DESCRIPTION
The bug in my case appears only when the redirection is turned off
and the redirection is handled by opening a new connection by using
the location header.
I have set the request property by using setRequestProperty(key,value)
and the getRequestProperty(key) returns the values I have set.
But these values are not being sent to the web server but the default
values are being sent instead.
Here are the values sent to the web server.
ALL_RAW Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Host:
test-pc User-Agent: Java1.2.2
Client Side:
HttpURLConnection.setFollowRedirects(false);
URL u = new URL("http://my-store.inktomi.com/default.asp"); //This url is
inside firewall and cannot be accesed.
URLConnection uc = (HttpURLConnection) u.openConnection();
uc.setRequestProperty ("Cookie",
"ASPSESSIONIDGQGGGHHV=KKILIEHBGPHDKOHDMGOLGHFB");
uc.setRequestProperty ("User-Agent", "Mozilla/4.0 (compatible; MSIE 4.01;
Windows NT)");
// readFromURLConnection(); // Get the streams and read the document
String location = uc.getHeaderField("Location");
uc.close();
URL ru = new URL(location);
URLConnection ruc = (HttpURLConnection) ru.openConnection();
ruc.setRequestProperty ("Cookie",
"ASPSESSIONIDGQGGGHHV=KKILIEHBGPHDKOHDMGOLGHFB");
ruc.setRequestProperty ("User-Agent", "Mozilla/4.0 (compatible; MSIE 4.01;
Windows NT)");
// readFromURLConnection(); // Get the streams and read the document
// The webser since it never gets the cookeis returns an error document as
the session is not traced
ruc.close();
Server Side trace:
Original Request:
Accept: application/vnd.ms-excel, application/msword,
application/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */* Accept-Language: en-us Connection: close User-Agent:
Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Pragma: Cookie:
ASPSESSIONIDGQGGGHHV=MKILIEHBPGKPIMNJDDCPIKLI Authorization:
If-Modified-Since: Content-Length: 0 Content-Type: accept-charset:
accept-encoding: gzip, deflate
Redirected Request:
ALL_RAW Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Host:
test-pc User-Agent: Java1.2.2
- backported by
-
JDK-2031088 setRequestProperty(key,value) when redirection is turned off
- Resolved
-
JDK-2031087 setRequestProperty(key,value) when redirection is turned off
- Closed
- relates to
-
JDK-4113495 The java.net.URLConnection.setDefaultRequestProperty() does not work.
- Resolved