Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/org/spdx/crossref/Live.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class Live implements Callable<Boolean> {
public Live(String url) {
this.url = url;
}

/**
* @param URLName the url in string form
* @return true/false if the url is live or not
Expand All @@ -49,7 +49,7 @@ public static boolean urlLinkExists(String URLName){
HttpURLConnection.setFollowRedirects(true);
HttpURLConnection con = (HttpURLConnection) new URL(URLName).openConnection();
// fake request coming from browser
con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36");
con.setRequestProperty("User-Agent", "Mozilla/5.0 SPDX LicenseListPublisher (File issues on the https://github.com/spdx/LicenseListPublisher/ issue tracker.)");
con.setRequestMethod("HEAD");
con.setConnectTimeout(30000);
con.setReadTimeout(30000);
Expand All @@ -63,7 +63,7 @@ public static boolean urlLinkExists(String URLName){
return false;
}
}

@Override
public Boolean call() throws Exception {
return urlLinkExists(url);
Expand Down
Loading