Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

ERROR: you have to use the allow_redirects options #12

Open
davdi1982 opened this issue Oct 13, 2018 · 0 comments
Open

ERROR: you have to use the allow_redirects options #12

davdi1982 opened this issue Oct 13, 2018 · 0 comments

Comments

@davdi1982
Copy link

Hi,

I'am using it on a symfony 4 project with Goutte and Guzzle 6.3.

I have try:

1/ 'allow_redirects' => true,
2/ 'allow_redirects' => [
'max' => 1,
'strict' => false,
'referer' => false,
'protocols' => ['http', 'https'],
'track_redirects' => true
],

Rest of the code::
$client = new GoutteClient();

        $guzzleClient = new GuzzleClient([
            'proxy' => $proxy,
            'timeout' => 120,
            'verify' => false,
            'cookies' => new FileCookieJar('/tmp/cookies.txt'),
            'allow_redirects' => [
                'max'             => 1,
                'strict'          => false,
                'referer'         => false,
                'protocols'       => ['http', 'https'],
                'track_redirects' => true
            ],
            'headers' => [
                'User-Agent' => 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36',

            ],
        ]);
        $guzzleClient->getConfig('handler')->push(CloudflareMiddleware::create());


        $client->setClient($guzzleClient);

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant