tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.22k stars 1.52k forks source link

AWS S3 signed url check fail #590

Open 2acode opened 1 year ago

2acode commented 1 year ago

Hi, the 'url_exists' function in 'tcpdf_static.php' always returns 403 using private images (signed url) from an S3 storage.

I think the problem is the CURLOPT_NOBODY option automatically changing the call to HEAD instead of keeping GET.

I haven't found a solution to continue using curl, setting CURLOPT_NOBODY to false returns the whole body and I don't know if it's worth it. You could probably either use a different function for url checking or at least have an option to disable checking.

References: https://github.com/tecnickcom/tc-lib-pdf/issues/79 https://github.com/tecnickcom/TCPDF/pull/96#issuecomment-431998926 https://curl.se/libcurl/c/CURLOPT_NOBODY.html

Thanks Alessandro