From ca2f39b5a97433fcafcf33698f330dc449d8173a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Garc=C3=ADa?= Date: Tue, 17 Sep 2024 14:29:15 +0200 Subject: [PATCH] Update Atom link protocol check in CapabilitiesLinkFixer --- .../database/linkchecker/entities/helper/DocumentLink.java | 7 +++++++ .../geocat/service/capabilities/CapabilitiesLinkFixer.java | 3 +++ 2 files changed, 10 insertions(+) diff --git a/services/linkchecker/src/main/java/net/geocat/database/linkchecker/entities/helper/DocumentLink.java b/services/linkchecker/src/main/java/net/geocat/database/linkchecker/entities/helper/DocumentLink.java index 1255ecc..efa442a 100644 --- a/services/linkchecker/src/main/java/net/geocat/database/linkchecker/entities/helper/DocumentLink.java +++ b/services/linkchecker/src/main/java/net/geocat/database/linkchecker/entities/helper/DocumentLink.java @@ -102,6 +102,13 @@ public DocumentLink() { "INSPIRE Atom".toLowerCase() }); + public static List validAtomProtocols = Arrays.asList(new String[]{ + "https://tools.ietf.org/html/rfc4287".toLowerCase(), + "ATOM Syndication Format".toLowerCase(), + "atom", + "INSPIRE Atom".toLowerCase() + }); + public static List validAppProfiles = Arrays.asList(new String[]{ "Download Service".toLowerCase(), "View Service".toLowerCase(), diff --git a/services/linkchecker/src/main/java/net/geocat/service/capabilities/CapabilitiesLinkFixer.java b/services/linkchecker/src/main/java/net/geocat/service/capabilities/CapabilitiesLinkFixer.java index 582392f..45ebb9e 100644 --- a/services/linkchecker/src/main/java/net/geocat/service/capabilities/CapabilitiesLinkFixer.java +++ b/services/linkchecker/src/main/java/net/geocat/service/capabilities/CapabilitiesLinkFixer.java @@ -86,6 +86,9 @@ public boolean isAtom(String link, DocumentLink documentLink) { if ((documentLink == null) || (documentLink.getProtocol() == null) || (documentLink.getProtocol().isEmpty())) return false; String protocol = documentLink.getProtocol().toLowerCase(); + + if (DocumentLink.validAtomProtocols.contains(protocol)) + return true; if (protocol.endsWith("-rss")) return true; if (protocol.endsWith("atom"))