diff --git a/composer.json b/composer.json index 858fa7e..fafaa03 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "illuminate/console": "^6.0 || ^7.0 || ^8.0 || ^9.0", "illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0", "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0", + "lmc/http-constants": "^1.2", "nesbot/carbon": "^1.20 || ^2.0", "psr/http-message": "^1.0.1" }, diff --git a/src/Services/Checker.php b/src/Services/Checker.php index 6249b5c..dbe18b9 100644 --- a/src/Services/Checker.php +++ b/src/Services/Checker.php @@ -24,6 +24,7 @@ use DragonCode\LastModified\Concerns\Urlable; use DragonCode\Support\Concerns\Makeable; use Illuminate\Http\Request; +use Lmc\HttpConstants\Header; /** * @method static Checker make(Request $request = null) @@ -83,7 +84,7 @@ protected function find(): ?DateTimeInterface protected function modifiedSince() { - return $this->request->headers->getDate('If-Modified-Since'); + return $this->request->headers->getDate(Header::IF_MODIFIED_SINCE); } protected function doesntRequest(): bool diff --git a/tests/Concerns/Requests.php b/tests/Concerns/Requests.php index b02acc3..e8f899c 100644 --- a/tests/Concerns/Requests.php +++ b/tests/Concerns/Requests.php @@ -21,6 +21,7 @@ use Carbon\Carbon; use Illuminate\Http\Request; +use Lmc\HttpConstants\Header; trait Requests { @@ -33,7 +34,7 @@ trait Requests protected function request(string $url, Carbon $date = null) { if (! empty($date)) { - $this->withHeader('If-Modified-Since', $date->format('r')); + $this->withHeader(Header::IF_MODIFIED_SINCE, $date->format('r')); } return $this->get($url);