Skip to content

Commit

Permalink
add option to adjust accept-encoding in curl engine #355
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Nov 4, 2022
1 parent bad015a commit 9a11f7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ protected function _curl($url,$options) {
curl_setopt($curl,CURLOPT_POSTFIELDS,$options['content']);
if (isset($options['proxy']))
curl_setopt($curl,CURLOPT_PROXY,$options['proxy']);
curl_setopt($curl,CURLOPT_ENCODING,'gzip,deflate');
curl_setopt($curl,CURLOPT_ENCODING,isset($options['encoding'])
? $options['encoding'] : 'gzip,deflate');
$timeout=isset($options['timeout'])?
$options['timeout']:
ini_get('default_socket_timeout');
Expand Down Expand Up @@ -617,7 +618,8 @@ function request($url,array $options=NULL) {
}
$this->subst($options['header'],
[
'Accept-Encoding: gzip,deflate',
'Accept-Encoding: '.(isset($options['encoding'])?
$options['encoding']:'gzip,deflate'),
'User-Agent: '.(isset($options['user_agent'])?
$options['user_agent']:
'Mozilla/5.0 (compatible; '.php_uname('s').')'),
Expand Down

0 comments on commit 9a11f7b

Please sign in to comment.