ensure binary write of screenshots

This commit is contained in:
Kyle Drake 2024-09-18 09:37:13 -05:00
parent 48cef121a1
commit 0e827319cd

View file

@ -47,7 +47,7 @@ class ScreenshotWorker
http_resp = HTTP.basic_auth(user: api_user, pass: api_password).get(uri) http_resp = HTTP.basic_auth(user: api_user, pass: api_password).get(uri)
BlackBox.new(site, path).check_uri(http_resp.headers['X-URL']) if defined?(BlackBox) && http_resp.headers['X-URL'] BlackBox.new(site, path).check_uri(http_resp.headers['X-URL']) if defined?(BlackBox) && http_resp.headers['X-URL']
File.write base_image_tmpfile_path, http_resp.to_s File.binwrite base_image_tmpfile_path, http_resp.body.to_s
user_screenshots_path = File.join SCREENSHOTS_PATH, Site.sharding_dir(username), username user_screenshots_path = File.join SCREENSHOTS_PATH, Site.sharding_dir(username), username
screenshot_path = File.join user_screenshots_path, File.dirname(path) screenshot_path = File.join user_screenshots_path, File.dirname(path)