From 27959505c01c5c5bea6983aa73d7448ffa13777e Mon Sep 17 00:00:00 2001 From: Vincenzo Date: Wed, 10 Apr 2024 08:48:32 +0200 Subject: [PATCH] Improve browser compatibility (#18) * Performance and compatibility tweaks * Cosmetic improvements --- build.gradle | 2 +- .../controller/RetroSearchController.java | 5 ++++ src/main/resources/application.properties | 1 + .../resources/templates/fragments/footer.html | 26 +++++++++++-------- .../templates/{index.html => home.html} | 0 5 files changed, 22 insertions(+), 12 deletions(-) rename src/main/resources/templates/{index.html => home.html} (100%) diff --git a/build.gradle b/build.gradle index 06f9f31..350e980 100644 --- a/build.gradle +++ b/build.gradle @@ -38,7 +38,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-actuator' implementation 'org.jsoup:jsoup:1.16.2' - implementation 'commons-validator:commons-validator:1.7' + implementation 'commons-validator:commons-validator:1.8.0' implementation 'org.apache.httpcomponents:httpclient:4.5.14' implementation 'net.dankito.readability4j:readability4j:1.0.8' compileOnly 'org.projectlombok:lombok' diff --git a/src/main/java/it/garambo/retrosearch/controller/RetroSearchController.java b/src/main/java/it/garambo/retrosearch/controller/RetroSearchController.java index 76811b5..590ff2a 100644 --- a/src/main/java/it/garambo/retrosearch/controller/RetroSearchController.java +++ b/src/main/java/it/garambo/retrosearch/controller/RetroSearchController.java @@ -22,6 +22,11 @@ public class RetroSearchController { @Autowired private UrlValidator urlValidator; @Autowired private ModernHtmlParser htmlParser; + @GetMapping("/") + public String home() { + return "home"; + } + @GetMapping("/search") public String search( @RequestParam() Optional query, @RequestParam Optional locale, Model model) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 965d56a..a2706d6 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,5 @@ management.server.port=3000 +server.compression.enabled=true server.error.whitelabel.enabled=false retrosearch.encoding=UTF-8 retrosearch.html.version=3.2 diff --git a/src/main/resources/templates/fragments/footer.html b/src/main/resources/templates/fragments/footer.html index fa064f7..45b277c 100644 --- a/src/main/resources/templates/fragments/footer.html +++ b/src/main/resources/templates/fragments/footer.html @@ -1,14 +1,18 @@ -
+

RetroSearch is an open source project built by @garambo -| Search results from DuckDuckGo +| Open a GitHub Issue

-

Search and Browse the WWW like it's 1997

- - HTML: - - | Encoding: - - | Version: - - \ No newline at end of file +

+ Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo +

+

+ + HTML: + + | Encoding: + + | Version: + + +

\ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/home.html similarity index 100% rename from src/main/resources/templates/index.html rename to src/main/resources/templates/home.html