Fixes upstream issue #1350.
Notes:
Image uploads were incorrectly handled by Dino, as they were always
reported as completed even if they were not, maybe so as to show the
image preview from the start. Now, Dino shows the upload progress for
all file types, and the image is only shown when completed.
(cherry picked from commit 700708b7e10ce1110528a2b83b854fae3f6be95e)
Some services use Authorization header [0] to pass upload credential
data. This avoids the token being exposed in server logs and is allowed
by XEP-0363 since version 0.5.0.
This change adds support for headers allowed in XEP-0363: Authorization,
Expires and Cookie.
[0]: https://xmpp.org/extensions/xep-0363.html#request
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".