diff --git a/CHANGELOG.md b/CHANGELOG.md index c7679799..e9e98e83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,17 +9,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * [#1089](https://github.com/shlinkio/shlink/issues/1089) Added new `ENABLE_PERIODIC_VISIT_LOCATE` env var to docker image which schedules the `visit:locate` command every hour when provided with value `true`. * [#1082](https://github.com/shlinkio/shlink/issues/1082) Added support for error correction level on QR codes. - Now, when calling the `GET /{shorCode}/qr-code` URL, you can pass the `errorCorrection` query param with values `L` for Low, `M` for Medium, `Q` for Quartile or `H` for High. + Now, when calling the `GET /{shorCode}/qr-code` URL, you can pass the `errorCorrection` query param with values `L` for Low, `M` for Medium, `Q` for Quartile or `H` for High. * [#1080](https://github.com/shlinkio/shlink/issues/1080) Added support to redirect to URLs as soon as the path starts with a valid short code, appending the rest of the path to the redirected long URL. - With this, if you have the `https://example.com/abc123` short URL redirecting to `https://www.twitter.com`, a visit to `https://example.com/abc123/shlinkio` will take you to `https://www.twitter.com/shlinkio`. + With this, if you have the `https://example.com/abc123` short URL redirecting to `https://www.twitter.com`, a visit to `https://example.com/abc123/shlinkio` will take you to `https://www.twitter.com/shlinkio`. - This behavior needs to be actively opted in, via installer config options or env vars. + This behavior needs to be actively opted in, via installer config options or env vars. * [#943](https://github.com/shlinkio/shlink/issues/943) Added support to define different "not-found" redirects for every domain handled by Shlink. - Shlink will continue to allow defining the default values via env vars or config, but afterwards, you can use the `domain:redirects` command to define specific values for every single domain. + Shlink will continue to allow defining the default values via env vars or config, but afterwards, you can use the `domain:redirects` command to define specific values for every single domain. ### Changed * [#1118](https://github.com/shlinkio/shlink/issues/1118) Increased phpstan required level to 8. @@ -34,6 +34,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this * *Nothing* +## [2.7.2] - 2021-07-30 +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#1128](https://github.com/shlinkio/shlink/issues/1128) Increased memory limit reserved for the docker image, preventing it from crashing on GeoLite db download. + + ## [2.7.1] - 2021-05-30 ### Added * *Nothing* diff --git a/composer.json b/composer.json index 1dbe2aa8..f71ffde0 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "endroid/qr-code": "^4.0", "geoip2/geoip2": "^2.9", "guzzlehttp/guzzle": "^7.0", + "guzzlehttp/psr7": "^1.7", "happyr/doctrine-specification": "^2.0", "jaybizzle/crawler-detect": "^1.2", "laminas/laminas-config": "^3.3", diff --git a/docker/config/php.ini b/docker/config/php.ini index f6c718d0..fca44924 100644 --- a/docker/config/php.ini +++ b/docker/config/php.ini @@ -1,3 +1,4 @@ log_errors_max_len=0 zend.assertions=1 assert.exception=1 +memory_limit=256M diff --git a/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php b/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php index b4bc1952..1e773f21 100644 --- a/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php +++ b/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php @@ -6,11 +6,18 @@ namespace Shlinkio\Shlink\Rest\Middleware; use Laminas\Diactoros\Response\EmptyResponse; use Mezzio\Router\Middleware\ImplicitOptionsMiddleware; +use Psr\Http\Message\ResponseFactoryInterface; +use Psr\Http\Message\ResponseInterface; class EmptyResponseImplicitOptionsMiddlewareFactory { public function __invoke(): ImplicitOptionsMiddleware { - return new ImplicitOptionsMiddleware(fn () => new EmptyResponse()); + return new ImplicitOptionsMiddleware(new class implements ResponseFactoryInterface { + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface + { + return new EmptyResponse(); + } + }); } } diff --git a/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php b/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php index 9d216913..4928f2ef 100644 --- a/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php +++ b/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php @@ -7,6 +7,7 @@ namespace ShlinkioTest\Shlink\Rest\Middleware; use Laminas\Diactoros\Response\EmptyResponse; use Mezzio\Router\Middleware\ImplicitOptionsMiddleware; use PHPUnit\Framework\TestCase; +use Psr\Http\Message\ResponseFactoryInterface; use ReflectionObject; use Shlinkio\Shlink\Rest\Middleware\EmptyResponseImplicitOptionsMiddlewareFactory; @@ -34,6 +35,10 @@ class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase $ref = new ReflectionObject($instance); $prop = $ref->getProperty('responseFactory'); $prop->setAccessible(true); - self::assertInstanceOf(EmptyResponse::class, $prop->getValue($instance)()); + + /** @var ResponseFactoryInterface $value */ + $value = $prop->getValue($instance); + + self::assertInstanceOf(EmptyResponse::class, $value->createResponse()); } }