From 92535c63f35f617bc90a0dde3c4d54b28d6c68bc Mon Sep 17 00:00:00 2001 From: mrizzi Date: Tue, 16 Jan 2024 15:17:51 +0100 Subject: [PATCH] Added 'User-Agent' property to links test Signed-off-by: mrizzi --- .../java/org/jboss/windup/rules/tests/WindupRulesLinksTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/rules/src/test/java/org/jboss/windup/rules/tests/WindupRulesLinksTest.java b/rules/src/test/java/org/jboss/windup/rules/tests/WindupRulesLinksTest.java index 5d6e4b2bd..168a51fc9 100644 --- a/rules/src/test/java/org/jboss/windup/rules/tests/WindupRulesLinksTest.java +++ b/rules/src/test/java/org/jboss/windup/rules/tests/WindupRulesLinksTest.java @@ -168,6 +168,7 @@ private boolean isValidLink(final String link) final HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); // property name from https://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html urlConn.setConnectTimeout(Integer.getInteger("sun.net.client.defaultConnectTimeout", 5000)); + urlConn.addRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0"); urlConn.connect(); returnCode = urlConn.getResponseCode(); } catch (IOException e) {