24 lines
508 B
PHP
24 lines
508 B
PHP
<?php
|
|
// PragmaHeader.php
|
|
// Created: 2022-02-14
|
|
// Updated: 2022-02-14
|
|
|
|
namespace Index\Http\Headers;
|
|
|
|
use Index\Http\HttpHeader;
|
|
|
|
class PragmaHeader {
|
|
private bool $noCache;
|
|
|
|
public function __construct(bool $noCache) {
|
|
$this->noCache = $noCache;
|
|
}
|
|
|
|
public function shouldByPassCache(): bool {
|
|
return $this->noCache;
|
|
}
|
|
|
|
public static function parse(HttpHeader $header): PragmaHeader {
|
|
return new PragmaHeader($header->getFirstLine() === 'no-cache');
|
|
}
|
|
}
|