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:
@@ -97,6 +97,10 @@ module Sources
|
||||
assert_equal("uroobnad", @site.artist_name)
|
||||
end
|
||||
|
||||
should "get the remote image size" do
|
||||
assert_equal(854_653, @site.remote_size)
|
||||
end
|
||||
|
||||
should "get the full size image url" do
|
||||
assert_equal("https://i.pximg.net/img-original/img/2017/11/21/05/12/37/65981735_p0.jpg", @site.image_url)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user