URL previews lose User-Agent setting mid-preview
What happened?
I'd noticed URL previews were not working quite right with a source (CBC.ca) that doesn't like "weird"(?) user agents. In testing to my own website, I see the following from Sharkey.
158.69.118.143 - - [11/Jan/2025:20:16:25 +0000] "HEAD / HTTP/1.1" 302 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0"
158.69.118.143 - - [11/Jan/2025:20:16:26 +0000] "HEAD /tiki-index.php HTTP/1.1" 200 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0"
158.69.118.143 - - [11/Jan/2025:20:16:26 +0000] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0"
158.69.118.143 - - [11/Jan/2025:20:16:26 +0000] "GET /tiki-index.php HTTP/1.1" 200 17212 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0"
158.69.118.143 - - [11/Jan/2025:20:16:26 +0000] "HEAD /themes/base_files/favicons/favicon.ico HTTP/1.1" 200 0 "-" "got (https://github.com/sindresorhus/got)"
158.69.118.143 - - [11/Jan/2025:20:16:27 +0000] "GET /themes/base_files/favicons/favicon.ico HTTP/1.1" 200 15086 "-" "Misskey/2024.11.2 (https://humanwords.cc/)"
158.69.118.143 - - [11/Jan/2025:20:16:27 +0000] "GET /themes/base_files/favicons/apple-touch-icon.png HTTP/1.1" 200 10613 "-" "Misskey/2024.11.2 (https://humanwords.cc/)"
So while Sharkey is working on the URL preview, it starts with the custom User agent, but then it changes when fetching images, initially to "got ..." and then "Misskey...".
What did you expect to happen?
The custom User-Agent should be used for all URL preview fetches.
Version
2024.11.2
Instance
humanwords.cc
What type of issue is this?
backend, I believe
How do you deploy Sharkey on your server? (Server-side issues only)
Manually
What operating system are you using? (Server-side issues only)
Gentoo
Relevant log output
Above.
Contribution Guidelines
By submitting this issue, you agree to follow our Contribution Guidelines
- I agree to follow this project's Contribution Guidelines
- I have searched the issue tracker for similar issues, and I do not believe this is a duplicate.