Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpGet getRedirectURL() == null #185

Open
brianmajor opened this issue Mar 16, 2022 · 1 comment
Open

HttpGet getRedirectURL() == null #185

brianmajor opened this issue Mar 16, 2022 · 1 comment
Labels

Comments

@brianmajor
Copy link
Member

With the following code, getResponseHeader("Location") returns the redirect URL, but getRedirectURL() returns null.

HttpGet get = new HttpGet(url, false);  // don't follow redirects
get.run();
log.info("response code: " + get.getResponseCode());  // 302
log.info("location: " + get.getResponseHeader("Location"));  // url
log.info("location: " + get.getRedirectURL());  // null
@brianmajor brianmajor added the bug label Mar 16, 2022
@pdowler
Copy link
Member

pdowler commented Mar 16, 2022

see checkRedirects(...) in HttpTransfer... it assigns the value returned by getRedirectURL() for some response codes...

maybe it is missing one of the codes?

checkRedirects(...) is called right after checkErrors(...) in HttpGet (line ~259)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants