Add User_agent header for documentation links checker

Closes #42164

Signed-off-by: rmartinc <rmartinc@redhat.com>
Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
Co-authored-by: Alexander Schwartz <aschwart@redhat.com>
(cherry picked from commit 93791f67fba08c15be229d1acf7f573d305ccc35)
This commit is contained in:
Ricardo Martin 2025-09-09 23:02:42 +02:00 committed by Alexander Schwartz
parent 090f8ffa80
commit 491ec37376

View File

@ -81,6 +81,7 @@ public class HttpUtils {
// add common headers that are needed by some pages
method.addHeader(HttpHeaders.ACCEPT_LANGUAGE, "en-US,en;q=0.9");
method.addHeader(HttpHeaders.ACCEPT, "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
method.addHeader(HttpHeaders.USER_AGENT, "Java/" + System.getProperty("java.version") + " (https://www.keycloak.org; keycloak-dev@googlegroups.com)");
client.execute(method, responseHandler);
} catch (Exception e) {
response.setError("exception " + e.getMessage());