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".
This commit is contained in:
Wiktor Kwapisiewicz 2019-10-22 17:18:37 +02:00 committed by fiaxh
parent 247a368150
commit 0acbe4855d

View file

@ -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) {