GC_Http_Encoding::should_decode()
最后更新于:2021-12-01 11:12:38
GC_( array|string$headers)Whether the content be decoded based on the headers.
参数
- $headers
-
(array|string) (Required) All of the available headers.
响应
(bool)
源文件
文件: gc-includes/class-gc-http-encoding.php
public static function should_decode( $headers ) {
if ( is_array( $headers ) ) {
if ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) {
return true;
}
} elseif ( is_string( $headers ) ) {
return ( stripos( $headers, 'content-encoding:' ) !== false );
}
return false;
}