forked from blallo/rss-bridge
[BridgeAbstract] handle compressed data
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
2ca7129e22
commit
70c490d6ef
1 changed files with 23 additions and 0 deletions
|
@ -364,6 +364,29 @@ abstract class BridgeAbstract implements BridgeInterface {
|
||||||
if($content === false)
|
if($content === false)
|
||||||
$this->debugMessage('Cant\'t download ' . $url);
|
$this->debugMessage('Cant\'t download ' . $url);
|
||||||
|
|
||||||
|
// handle compressed data
|
||||||
|
foreach($http_response_header as $header){
|
||||||
|
if(stristr($header, 'content-encoding')){
|
||||||
|
switch(true){
|
||||||
|
case stristr($header, 'gzip'):
|
||||||
|
$content = gzinflate( substr($content,10,-8));
|
||||||
|
break;
|
||||||
|
case stristr($header, 'compress'):
|
||||||
|
//TODO
|
||||||
|
case stristr($header, 'deflate'):
|
||||||
|
//TODO
|
||||||
|
case stristr($header, 'brotli'):
|
||||||
|
//TODO
|
||||||
|
returnServerError($header . '=> Not implemented yet');
|
||||||
|
break;
|
||||||
|
case stristr($header, 'identity'):
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
returnServerError($header . '=> Unknown compression');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue