From 4a1e7b8d5ad9098bff49295384fff5e9d9b97133 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 19 Dec 2021 10:23:55 +0100 Subject: [PATCH] Changed condition to pipe RequestIdMiddleware, so that it applies to non-rest requests too --- CHANGELOG.md | 17 +++++++++++++++++ config/autoload/middleware-pipeline.global.php | 2 +- config/autoload/swoole.global.php | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee4a64c6..bf07ce02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] +### Added +* *Nothing* + +### Changed +* *Nothing* + +### Deprecated +* *Nothing* + +### Removed +* *Nothing* + +### Fixed +* [#1286](https://github.com/shlinkio/shlink/issues/1286) Fixed `x-request-id` header not being generated during non-rest requests. + + ## [2.10.0] - 2021-12-12 ### Added * [#1163](https://github.com/shlinkio/shlink/issues/1163) Allowed setting not-found redirects for default domain in the same way it's done for any other domain. diff --git a/config/autoload/middleware-pipeline.global.php b/config/autoload/middleware-pipeline.global.php index becd3ad3..c628c4fd 100644 --- a/config/autoload/middleware-pipeline.global.php +++ b/config/autoload/middleware-pipeline.global.php @@ -17,6 +17,7 @@ return [ 'error-handler' => [ 'middleware' => [ ContentLengthMiddleware::class, + RequestIdMiddleware::class, ErrorHandler::class, Rest\Middleware\CrossDomainMiddleware::class, ], @@ -24,7 +25,6 @@ return [ 'error-handler-rest' => [ 'path' => '/rest', 'middleware' => [ - RequestIdMiddleware::class, ProblemDetails\ProblemDetailsMiddleware::class, ], ], diff --git a/config/autoload/swoole.global.php b/config/autoload/swoole.global.php index ad4e3792..f7159ed7 100644 --- a/config/autoload/swoole.global.php +++ b/config/autoload/swoole.global.php @@ -22,7 +22,7 @@ return (static function () { 'options' => [ 'worker_num' => (int) env('WEB_WORKER_NUM', 16), - 'task_worker_num' => $taskWorkers < MIN_TASK_WORKERS ? MIN_TASK_WORKERS : $taskWorkers, + 'task_worker_num' => max($taskWorkers, MIN_TASK_WORKERS), ], ], ],