Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssetHelper fopen and assetDownloadCurl additional HTTP headers #1538

Open
jamesmacwhite opened this issue Oct 31, 2024 · 0 comments
Open

AssetHelper fopen and assetDownloadCurl additional HTTP headers #1538

jamesmacwhite opened this issue Oct 31, 2024 · 0 comments
Labels

Comments

@jamesmacwhite
Copy link
Contributor

jamesmacwhite commented Oct 31, 2024

Description

I have a feed which provides CDN image paths, we have these linked to an asset field to import but the origin server throws a 403 Forbidden error on requests for the image which are lacking a User-Agent value. I confirmed it locally by running wget/curl with and without.

Example error

thumbImage - Asset error: https://cdn.ticketsource.co.uk/images/promoter/banner/66148-1713969775145-m.png - fopen(https://cdn.ticketsource.co.uk/images/promoter/banner/66148-1713969775145-m.png): Failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden .

The setting assetDownloadCurl exists, but the issue is there is no way to set additional curl options on the asset download request

fopen can also provide HTTP headers as well, but this is currently not possible to define without forking or using FeedMe events to fetch the image with a client that provides the required headers.

Additional info

  • Craft version: 5.4.9
  • PHP version: 8.3
  • Database driver & version: MySQL 8.0
  • Plugins & versions: FeedMe 6.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant