Skip to content

Commit

Permalink
Merge pull request #44 from deanblackborough/v1.12.5
Browse files Browse the repository at this point in the history
v1.12.5
  • Loading branch information
deanblackborough committed Jun 6, 2020
2 parents 659bc44 + c27e755 commit b19c79b
Show file tree
Hide file tree
Showing 15 changed files with 587 additions and 171 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
/vendor
/public/node_modules
/public/hot
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

The complete changelog for the Costs to Expect Website, our changelog follows the format defined at https://keepachangelog.com/en/1.0.0/

## [v1.12.5] - 2020-06-06
### Changed
- We are updating the Website to run on PHP7.4.
- We have updated the Website to work with v2.11.0 of the Costs to Expect API. The format of the categories object was updated.
- We have tweaked the Docker setup, we have added a network.
### Fixed
- When we hastily added the caching, we did not cache the response headers, only the body. We have updated the Website to cache the response body and headers.
- We have removed a link that would direct the user to a page we know will not have content.

## [v1.12.4] - 2020-05-14
### Changed
- We have updated the dependencies for our website, front-end and back-end dependencies.
Expand Down
11 changes: 9 additions & 2 deletions app/Request/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,20 @@ private static function cacheableGetRequest(string $uri): ?array
->get($uri, true, [__CLASS__, __METHOD__]);

if ($response !== null) {
$cache->put($uri, $response);
$cache->put(
$uri,
[
'body' => $response,
'headers' => Http::getInstance()->previousRequestHeaders()
]
);
return $response;
}

return null;
} else {
return $cached;
Http::getInstance()->setHeaders($cached['headers']);
return $cached['body'];
}
}
}
5 changes: 5 additions & 0 deletions app/Request/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,9 @@ public static function previousRequestStatusCode(): ?int
{
return self::$status_code;
}

public function setHeaders($headers)
{
self::$headers = $headers;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"license": "MIT",
"require": {
"php": "^7.3",
"php": "^7.4",
"ext-json": "*",
"deanblackborough/laravel-view-helpers": "^1",
"fideloper/proxy": "^4.0",
Expand Down
Loading

0 comments on commit b19c79b

Please sign in to comment.