Skip to content

Commit 3869440

Browse files
committed
use Accept header to prevent some redirections
1 parent 00c23b4 commit 3869440

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Http/CurlDispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ class CurlDispatcher implements DispatcherInterface
1313
private $responses = [];
1414

1515
private $config = [
16-
CURLOPT_MAXREDIRS => 20,
16+
CURLOPT_MAXREDIRS => 10,
1717
CURLOPT_CONNECTTIMEOUT => 10,
1818
CURLOPT_TIMEOUT => 10,
1919
CURLOPT_SSL_VERIFYHOST => false,
2020
CURLOPT_SSL_VERIFYPEER => false,
2121
CURLOPT_ENCODING => '',
2222
CURLOPT_AUTOREFERER => true,
2323
CURLOPT_FOLLOWLOCATION => true,
24-
CURLOPT_USERAGENT => 'Embed PHP library',
2524
CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36',
2625
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
26+
CURLOPT_HTTPHEADER => ['Accept: text/html'],
2727
];
2828

2929
/**

0 commit comments

Comments
 (0)