diff --git a/code/features/screenshots/src/main/java/nu/marginalia/screenshot/ScreenshotService.java b/code/features/screenshots/src/main/java/nu/marginalia/screenshot/ScreenshotService.java index 50769aa6..69d00ba7 100644 --- a/code/features/screenshots/src/main/java/nu/marginalia/screenshot/ScreenshotService.java +++ b/code/features/screenshots/src/main/java/nu/marginalia/screenshot/ScreenshotService.java @@ -87,37 +87,38 @@ public class ScreenshotService { private Object serveSvgPlaceholder(Response response, int id) { - var domainName = domainQueries.getDomain(new EdgeId<>(id)).map(Object::toString); - if (domainName.isEmpty()) { - Spark.halt(404); - } + var name = domainQueries.getDomain(new EdgeId<>(id)).map(Object::toString) + .orElse("[Screenshot Not Yet Captured]"); response.type("image/svg+xml"); - return String.format("\n" + - "\n" + - " \n" + - " \n" + - " Placeholder\n" + - " %s\n" + - " \n" + - "\n", domainName.get()); + + return """ + + + + + Placeholder + %s + + \n + """.formatted(name); } } diff --git a/run/nginx-site.conf b/run/nginx-site.conf index 3b339af5..45535ac0 100644 --- a/run/nginx-site.conf +++ b/run/nginx-site.conf @@ -14,9 +14,8 @@ server { rewrite ^/explore/(.*)$ /search?query=browse:$1&profile=yolo; rewrite ^/links/(.*)$ /search?query=links:$1&profile=corpo; - location /screenshot { - proxy_pass http://assistant-service:5025/public$uri; + proxy_pass http://assistant-service:5025/public/screenshot; } location /site-search { proxy_pass http://search-service:5023/public/site-search;