mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-21 02:41:35 +00:00
Randomize User agents for reichelt and generic web provider
This might helps with #1176
This commit is contained in:
parent
e5dcfad3ff
commit
8f92615491
3 changed files with 107 additions and 6 deletions
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services\InfoProviderSystem\Providers;
|
||||
|
||||
use App\Helpers\RandomizeUseragentHttpClient;
|
||||
use App\Services\InfoProviderSystem\DTOs\FileDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\ParameterDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\PartDetailDTO;
|
||||
|
|
@ -30,7 +31,6 @@ use App\Services\InfoProviderSystem\DTOs\PriceDTO;
|
|||
use App\Services\InfoProviderSystem\DTOs\PurchaseInfoDTO;
|
||||
use App\Services\InfoProviderSystem\DTOs\SearchResultDTO;
|
||||
use App\Settings\InfoProviderSystem\ReicheltSettings;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
|
|
@ -39,10 +39,13 @@ class ReicheltProvider implements InfoProviderInterface
|
|||
|
||||
public const DISTRIBUTOR_NAME = "Reichelt";
|
||||
|
||||
public function __construct(private readonly HttpClientInterface $client,
|
||||
private readonly HttpClientInterface $client;
|
||||
|
||||
public function __construct(HttpClientInterface $client,
|
||||
private readonly ReicheltSettings $settings,
|
||||
)
|
||||
{
|
||||
$this->client = new RandomizeUseragentHttpClient($client);
|
||||
}
|
||||
|
||||
public function getProviderInfo(): array
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue