diff --git a/pom.xml b/pom.xml
index fe9fdfe1..76fe5a53 100755
--- a/pom.xml
+++ b/pom.xml
@@ -111,11 +111,6 @@
-->
-
- rome
- rome
- 1.0
-
org.apache.httpcomponents.core5
httpcore5
diff --git a/src/main/java/com/erudika/scoold/controllers/SearchController.java b/src/main/java/com/erudika/scoold/controllers/SearchController.java
index 57931ecc..b3c2dd79 100755
--- a/src/main/java/com/erudika/scoold/controllers/SearchController.java
+++ b/src/main/java/com/erudika/scoold/controllers/SearchController.java
@@ -37,16 +37,9 @@
import com.erudika.scoold.utils.ScooldUtils;
import com.redfin.sitemapgenerator.WebSitemapGenerator;
import com.redfin.sitemapgenerator.WebSitemapUrl;
-import com.sun.syndication.feed.synd.SyndContent;
-import com.sun.syndication.feed.synd.SyndContentImpl;
-import com.sun.syndication.feed.synd.SyndEntry;
-import com.sun.syndication.feed.synd.SyndEntryImpl;
-import com.sun.syndication.feed.synd.SyndFeed;
-import com.sun.syndication.feed.synd.SyndFeedImpl;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.SyndFeedOutput;
import jakarta.inject.Inject;
import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -55,6 +48,7 @@
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@@ -229,59 +223,40 @@ public ResponseEntity webmanifest(HttpServletRequest req) {
body(json);
}
- @ResponseBody
- @GetMapping("/feed.xml")
- public ResponseEntity feed(HttpServletRequest req) {
- String feed = "";
- try {
- feed = new SyndFeedOutput().outputString(getFeed(req));
- } catch (Exception ex) {
- logger.error("Could not generate feed", ex);
- }
- return ResponseEntity.ok().
- contentType(MediaType.APPLICATION_ATOM_XML).
- cacheControl(CacheControl.maxAge(1, TimeUnit.HOURS)).
- eTag(Utils.md5(feed)).
- body(feed);
- }
-
- private SyndFeed getFeed(HttpServletRequest req) throws IOException, FeedException {
+ @GetMapping(path = "/feed.xml", produces = "application/rss+xml")
+ public String feed(Model model, HttpServletRequest req, HttpServletResponse res) {
+ // [space query filter] + original query string
+ String qs = utils.sanitizeQueryString("*", req);
boolean canList = utils.isDefaultSpacePublic() || utils.isAuthenticated(req);
- List questions = canList ? utils.fullQuestionsSearch("*") : Collections.emptyList();
- List entries = new ArrayList();
+ List questions = canList ? utils.fullQuestionsSearch(qs) : Collections.emptyList();
+ List