]> cat aescling's git repositories - mastodon.git/commit
Fix upload of remote media with OpenStack Swift sometimes failing (#16998)
authorClaire <claire.github-309c@sitedethib.com>
Tue, 16 Nov 2021 20:36:28 +0000 (21:36 +0100)
committerGitHub <noreply@github.com>
Tue, 16 Nov 2021 20:36:28 +0000 (21:36 +0100)
commit48f8658d34f453f9e5687835e384e2ddeb81b509
tree514251babae2e1d9afe94fe784bff5d32c989498
parent3517867b7656ff506a04e394fc8c1a855b7d504a
Fix upload of remote media with OpenStack Swift sometimes failing (#16998)

Under certain conditions, files fetched from remotes trigger an error when
being uploaded using OpenStack Swift. This is because in some cases, the
remote server will not return a content-length, so our ResponseWithLimitAdapter
will hold a `nil` value for `#size`, which will lead to an invalid value
for the Content-Length header of the Swift API call.

This commit fixes that by taking the size from the actually-downloaded file
size rather than the upstream-provided Content-Length header value.
lib/paperclip/response_with_limit_adapter.rb