From 0acbe4855d1cfb42832aae1d18b668e2ceb18d2c Mon Sep 17 00:00:00 2001 From: Wiktor Kwapisiewicz Date: Tue, 22 Oct 2019 17:18:37 +0200 Subject: Fix reporting failed HTTP upload Status code can't be less than 200 and greater than or equal 300 at the same time. Using || instead of && marks all uploads that do not have 2xx status code as "failed". --- plugins/http-files/src/file_sender.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/http-files/src/file_sender.vala b/plugins/http-files/src/file_sender.vala index 65b33eb4..41829dd9 100644 --- a/plugins/http-files/src/file_sender.vala +++ b/plugins/http-files/src/file_sender.vala @@ -102,7 +102,7 @@ public class HttpFileSender : FileSender, Object { Soup.Session session = new Soup.Session(); try { yield session.send_async(message); - if (message.status_code < 200 && message.status_code >= 300) { + if (message.status_code < 200 || message.status_code >= 300) { throw new FileSendError.UPLOAD_FAILED("HTTP status code %s".printf(message.status_code.to_string())); } } catch (Error e) { -- cgit v1.2.3-70-g09d2