arturobernalg opened a new pull request, #535: URL: https://github.com/apache/jspwiki/pull/535
https://issues.apache.org/jira/browse/JSPWIKI-1226 The RSS and Atom feeds put relative links in the items and, for RSS 1.0, in the channel, for example `/wiki/Wiki.jsp?page=Main&version=2`. Feed validators reject them and `Entry#setURL` documents that it takes an absolute URL. `DefaultRSSGenerator` now builds the entry URLs and the feed URL as absolute URLs from the request origin, using `HttpUtil.getAbsoluteUrl()` as `RSS20Feed` already does for the channel link. The three `FIXME`s in `RSS10Feed`, `RSS20Feed` and `AtomFeed` that asked for this are removed. Without a request, as in the background `RSSThread`, there is no origin and the URLs are left unchanged. `RSSGeneratorTest.testEntryLinksAreAbsolute` checks the RSS 1.0, RSS 2.0 and Atom output. Before the change the item link was `/test/Wiki.jsp?...` and the RSS 1.0 channel link was relative; with the change they are absolute. The `jspwiki-main` test suite passes (928 tests). This does not add the `guid` and `atom:link rel="self"` elements that the validator also recommends, and the `enclosure` URLs and the `wiki:history` link are still relative. Those can be handled separately. #521 changes `HttpUtil.getAbsoluteUrl()`, which this change calls, but the two do not touch the same lines. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
