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

Http status code "303 See Other" can return a non-absolute url, which… #94

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import edu.uci.ics.crawler4j.crawler.authentication.FormAuthInfo;
import edu.uci.ics.crawler4j.crawler.authentication.NtAuthInfo;
import edu.uci.ics.crawler4j.crawler.exceptions.PageBiggerThanMaxSizeException;
import edu.uci.ics.crawler4j.url.UrlResolver;
import edu.uci.ics.crawler4j.url.WebURL;

/**
Expand Down Expand Up @@ -279,7 +280,7 @@ public PageFetchResult fetchPage(WebURL webUrl)

Header header = response.getFirstHeader(HttpHeaders.LOCATION);
if (header != null) {
String movedToUrl = normalizer.filter(header.getValue());
String movedToUrl = normalizer.filter(UrlResolver.resolveUrl(toFetchURL, header.getValue()));
fetchResult.setMovedToUrl(movedToUrl);
}
} else if (statusCode >= 200 && statusCode <= 299) { // is 2XX, everything looks ok
Expand Down