diff --git a/CCExtractorTester/Comparers/ServerComparer.cs b/CCExtractorTester/Comparers/ServerComparer.cs index 3d4d573..acd75ef 100644 --- a/CCExtractorTester/Comparers/ServerComparer.cs +++ b/CCExtractorTester/Comparers/ServerComparer.cs @@ -14,6 +14,8 @@ public class ServerComparer : IFileComparable /// private string reportUrl; + private static string userAgent = "CCExctractor Automated Test Suite"; + /// /// Generates an new instance of this class. /// @@ -30,12 +32,15 @@ public ServerComparer(string reportUrl) /// The data for this entry. public void CompareAndAddToResult(CompareData data) { + string hash = Hasher.getFileHash(data.ProducedFile); + // Check for equality by hash if (!Hasher.filesAreEqual(data.CorrectFile, data.ProducedFile)) { // Upload result using (var wb = new WebClient()) { + wb.Headers.Add("user-agent", userAgent); // TODO: check if this works var response = wb.UploadFile(reportUrl, data.ProducedFile); } @@ -45,6 +50,7 @@ public void CompareAndAddToResult(CompareData data) // Post equality status using (var wb = new WebClient()) { + wb.Headers.Add("user-agent", userAgent); var d = new NameValueCollection(); d["equal"] = data.ProducedFile; d["sample"] = data.SampleFile;