Skip to content

Commit

Permalink
Added 'User-Agent' property to links test
Browse files Browse the repository at this point in the history
Signed-off-by: mrizzi <[email protected]>
  • Loading branch information
mrizzi committed Jan 16, 2024
1 parent ba21a53 commit 92535c6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 92535c6

Please sign in to comment.