feat/scrapers-content-sources-healthcheck #24

Merged
colgora merged 3 commits from feat/scrapers-content-sources-healthcheck into main 2026-03-16 00:11:53 +01:00
2 changed files with 14 additions and 1 deletions
Showing only changes of commit 874003eb35 - Show all commits

View File

@@ -86,6 +86,7 @@
:src="imageUrl"
:alt="`Image ${index + 1}`"
class="w-full h-32 object-cover border border-gray-200 dark:border-gray-600"
referrerpolicy="no-referrer"
@error="handleImageError"
@load="handleImageLoad" />
<div class="absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-30 transition-opacity flex items-center justify-center">
@@ -278,6 +279,11 @@ const handleTest = async ({ configuration, testData }) => {
testResults.value = {};
try {
// Persister testSlug + testChapterNumber avant de lancer le test
if (isEditing.value) {
await contentSourceStore.updateSource(route.params.id, configuration);
}
// Préparer les données selon le format de l'API
const testConfiguration = {
baseUrl: configuration.baseUrl,

View File

@@ -20,7 +20,14 @@ readonly class ImageDownloader implements ImageDownloaderInterface
public function download(string $url, string $destination): void
{
$response = $this->httpClient->request('GET', $url);
$urlParts = parse_url($url);
$referer = ($urlParts['scheme'] ?? 'https') . '://' . ($urlParts['host'] ?? '');
$response = $this->httpClient->request('GET', $url, [
'headers' => [
'Referer' => $referer,
],
]);
$contentType = $response->getHeaders()['content-type'][0] ?? '';
if (!str_starts_with($contentType, 'image/')) {