浏览代码

Removed mezzio-helpers and used ContentLengthMiddleware from shlink-common

Alejandro Celaya 3 年之前
父节点
当前提交
9c48e6578d
共有 2 个文件被更改,包括 3 次插入8 次删除
  1. 1 2
      composer.json
  2. 2 6
      config/autoload/middleware-pipeline.global.php

+ 1 - 2
composer.json

@@ -36,7 +36,6 @@
         "lstrojny/functional-php": "^1.15",
         "mezzio/mezzio": "^3.3",
         "mezzio/mezzio-fastroute": "^3.1",
-        "mezzio/mezzio-helpers": "^5.3",
         "mezzio/mezzio-problem-details": "^1.3",
         "mezzio/mezzio-swoole": "^3.1",
         "monolog/monolog": "^2.0",
@@ -47,7 +46,7 @@
         "predis/predis": "^1.1",
         "pugx/shortid-php": "^0.7",
         "ramsey/uuid": "^3.9",
-        "shlinkio/shlink-common": "dev-main#62d4b84 as 3.5",
+        "shlinkio/shlink-common": "dev-main#2cf5e45 as 3.5",
         "shlinkio/shlink-config": "^1.0",
         "shlinkio/shlink-event-dispatcher": "^2.0",
         "shlinkio/shlink-importer": "^2.2",

+ 2 - 6
config/autoload/middleware-pipeline.global.php

@@ -5,22 +5,18 @@ declare(strict_types=1);
 namespace Shlinkio\Shlink;
 
 use Laminas\Stratigility\Middleware\ErrorHandler;
-use Mezzio\Helper;
 use Mezzio\ProblemDetails;
 use Mezzio\Router;
 use PhpMiddleware\RequestId\RequestIdMiddleware;
 use RKA\Middleware\IpAddress;
-
-use function extension_loaded;
+use Shlinkio\Shlink\Common\Middleware\ContentLengthMiddleware;
 
 return [
 
     'middleware_pipeline' => [
         'error-handler' => [
             'middleware' => [
-                // For some reason, with swoole 4.6.3, piping this middleware makes requests to have incomplete body or
-                // never finish loading. Disabling it for swoole fixes it as it already calculates the header on itself
-                ...extension_loaded('swoole') ? [] : [Helper\ContentLengthMiddleware::class],
+                ContentLengthMiddleware::class,
                 ErrorHandler::class,
             ],
         ],