commit 2a0aa8c7f8c956ba15c5780bc078d5330322fcd5 Author: iwakeh iwakeh@torproject.org Date: Wed Jan 31 13:31:24 2018 +0000
Use enum Method from metrics-lib. --- src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java b/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java index 88d62fa..a3d2a7e 100644 --- a/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java +++ b/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java @@ -15,6 +15,7 @@ import org.torproject.descriptor.DescriptorParseException; import org.torproject.descriptor.WebServerAccessLog; import org.torproject.descriptor.log.InternalLogDescriptor; import org.torproject.descriptor.log.InternalWebServerAccessLog; +import org.torproject.descriptor.log.Method; import org.torproject.descriptor.log.WebServerAccessLogImpl; import org.torproject.descriptor.log.WebServerAccessLogLine;
@@ -146,8 +147,8 @@ public class SanitizeWeblogs extends CollecTorMain { static Optional<String> sanitize(WebServerAccessLogLine logLine, LocalDate date) { if (!logLine.isValid() - || !("GET".equals(logLine.getMethod()) - || "HEAD".equals(logLine.getMethod())) + || !(Method.GET == logLine.getMethod() + || Method.HEAD == logLine.getMethod()) || !logLine.getProtocol().startsWith("HTTP") || 400 == logLine.getResponse() || 404 == logLine.getResponse()) { return Optional.empty();
tor-commits@lists.torproject.org