urlAfterRedirect was always null (#699)

This commit is contained in:
Athou
2015-01-12 09:57:30 +01:00
parent 9d64426b00
commit c4185034e4
2 changed files with 3 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ public class FeedFetcher {
byte[] content = result.getContent();
try {
fetchedFeed = parser.parse(feedUrl, content);
fetchedFeed = parser.parse(result.getUrlAfterRedirect(), content);
} catch (FeedException e) {
if (extractFeedUrlFromHtml) {
String extractedUrl = extractFeedUrl(StringUtils.newStringUtf8(result.getContent()), feedUrl);
@@ -50,7 +50,7 @@ public class FeedFetcher {
result = getter.getBinary(extractedUrl, lastModified, eTag, timeout);
content = result.getContent();
fetchedFeed = parser.parse(feedUrl, content);
fetchedFeed = parser.parse(result.getUrlAfterRedirect(), content);
} else {
throw e;
}

View File

@@ -77,7 +77,7 @@ public class FeedParser {
}
entry.setGuid(FeedUtils.truncate(guid, 2048));
entry.setUpdated(validateDate(getEntryUpdateDate(item), true));
entry.setUrl(FeedUtils.truncate(FeedUtils.toAbsoluteUrl(item.getLink(), feed.getLink(), feed.getUrlAfterRedirect()), 2048));
entry.setUrl(FeedUtils.truncate(FeedUtils.toAbsoluteUrl(item.getLink(), feed.getLink(), feedUrl), 2048));
// if link is empty but guid is used as url
if (StringUtils.isBlank(entry.getUrl()) && StringUtils.startsWith(entry.getGuid(), "http")) {