diff --git a/gradle.properties b/gradle.properties index 2941cdd4..59a90b0c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,3 @@ // version now handled in build.gradle -version=1.1.5 - - +version=1.1.7-SNAPSHOT diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/ProductVersion.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/ProductVersion.groovy index 65951abc..62fe6b88 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/ProductVersion.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/ProductVersion.groovy @@ -19,8 +19,8 @@ public class ProductVersion { Properties props = new Properties() props.load(RESOURCE.openConnection().inputStream) return props.getProperty("version"); - } catch (IOException E) { - logger.debug("ProductVersion cannot be obtained due to IOException.") + } catch (IOException e) { + logger.error("ProductVersion cannot be obtained due to IOException '{}'", e, e) } return "[unknown]"; } diff --git a/src/main/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksChecker.groovy b/src/main/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksChecker.groovy index 1fee2c9a..3936a2ee 100644 --- a/src/main/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksChecker.groovy +++ b/src/main/groovy/org/aim42/htmlsanitycheck/check/BrokenHttpLinksChecker.groovy @@ -1,6 +1,7 @@ package org.aim42.htmlsanitycheck.check import org.aim42.htmlsanitycheck.Configuration +import org.aim42.htmlsanitycheck.ProductVersion import org.aim42.htmlsanitycheck.collect.Finding import org.aim42.htmlsanitycheck.collect.SingleCheckResults import org.aim42.htmlsanitycheck.html.HtmlElement @@ -191,7 +192,7 @@ class BrokenHttpLinksChecker extends Checker { // to avoid nasty 403 errors (forbidden), we set a referrer and user-agent // connection.setRequestProperty("Referer", "https://aim42.org"); - connection.setRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0"); + connection.setRequestProperty("User-Agent", "hsc/${ProductVersion.getVersion()}"); // TODO followRedirects should be a configuration parameter // that defaults to false