mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-02 18:14:42 +02:00
Overhaul the usage of libcurl-impersonate (#4535)
libcurl-impersonate was not being used properly, as the code was overriding the headers set by it to prevent detection. - update the libcurl-impersonate to an actively managed lexiforest fork - impersonate Chrome 131 - move the defaultHttpHeaders to http.php, where it belongs - only set defaultHttpHeaders if curl-impersonate is not detected - make useragent ini setting optional and disabled by default - add necessary documentation updates
This commit is contained in:
parent
0f77d3ae0a
commit
b7c04f8587
6 changed files with 45 additions and 30 deletions
|
@ -64,19 +64,7 @@ function getContents(
|
|||
}
|
||||
}
|
||||
|
||||
// Snagged from https://github.com/lwthiker/curl-impersonate/blob/main/firefox/curl_ff102
|
||||
$defaultHttpHeaders = [
|
||||
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
|
||||
'Accept-Language' => 'en-US,en;q=0.5',
|
||||
'Upgrade-Insecure-Requests' => '1',
|
||||
'Sec-Fetch-Dest' => 'document',
|
||||
'Sec-Fetch-Mode' => 'navigate',
|
||||
'Sec-Fetch-Site' => 'none',
|
||||
'Sec-Fetch-User' => '?1',
|
||||
'TE' => 'trailers',
|
||||
];
|
||||
|
||||
$config['headers'] = array_merge($defaultHttpHeaders, $httpHeadersNormalized);
|
||||
$config['headers'] = $httpHeadersNormalized;
|
||||
|
||||
$maxFileSize = Configuration::getConfig('http', 'max_filesize');
|
||||
if ($maxFileSize) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue