uploads: fix incorrect remote sizes on pixiv uploads.
Bug: the uploads page showed a remote size of 146 bytes for Pixiv uploads. Cause: we didn't spoof the Referer header when making the HEAD request for the image, causing Pixiv to return a 403 error. Also fix the case where the Content-Length header is absent.
This commit is contained in:
@@ -8,7 +8,7 @@ class UploadService
|
||||
UploadPreprocessorDelayedStartJob.perform_later(url, ref, CurrentUser.user)
|
||||
|
||||
strategy = Sources::Strategies.find(url, ref)
|
||||
remote_size = strategy.size
|
||||
remote_size = strategy.remote_size
|
||||
|
||||
return [upload, remote_size]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user