Bug 25601 - setInstanceFollowRedirects ignored in java.net.HttpURLConnection
Summary: setInstanceFollowRedirects ignored in java.net.HttpURLConnection
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 3.3.6
: P3 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-30 12:11 UTC by Claudio Valente
Modified: 2005-12-30 18:01 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Example source (479 bytes, text/x-java)
2005-12-30 12:12 UTC, Claudio Valente
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Valente 2005-12-30 12:11:09 UTC
I wrote a small class to make a GET request, follow redirects and print the page's content.

In order to use the redirects I used the setInstanceFollowRedirects(true).

When I run it using SUN's vm everything works fine.

Compiling it with gcj results in a program that does output the page's content, but when the first response is a 302, it's stops there and doesn't do the following requests.

The same thing happens with the setFollowRedirects(true).

Seems like libgcj ignores the FollowRedirects
I got the redirect while testing with http://www.google.com/ (no slash at end results in Malformed HTTP header, but this bug has been solved), if the request comes from outside the USA, google redirects to a "local" google page.

My java jm:
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)
Comment 1 Claudio Valente 2005-12-30 12:12:45 UTC
Created attachment 10569 [details]
Example source

This is the code I used to isolate the bug.
Comment 2 Andrew Pinski 2005-12-30 18:01:15 UTC
Fixed in 4.1.0 at least.  It might also be fixed in 4.0.2 but I don't know for sure.