diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2019-10-22 17:18:37 +0200 |
---|---|---|
committer | fiaxh <fiaxh@users.noreply.github.com> | 2019-11-04 15:15:28 +0100 |
commit | 0acbe4855d1cfb42832aae1d18b668e2ceb18d2c (patch) | |
tree | a78be84ce29f03ba9a636fda36670b9d8ea88689 | |
parent | 247a36815043deb15c19edc536f7b2ec3a2d02c8 (diff) | |
download | dino-0acbe4855d1cfb42832aae1d18b668e2ceb18d2c.tar.gz dino-0acbe4855d1cfb42832aae1d18b668e2ceb18d2c.zip |
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".
-rw-r--r-- | plugins/http-files/src/file_sender.vala | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |