From 3385948a76e9b8485492b7fcb8f4b3f0c4c93508 Mon Sep 17 00:00:00 2001 From: Alexander Letnikow Date: Wed, 21 Nov 2018 13:52:21 +0200 Subject: [PATCH] Fix Request and Response validation rules for body and headers --- src/Log/Request.php | 4 ++-- src/Log/Response.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Log/Request.php b/src/Log/Request.php index a0ac1a1..7ae6c0a 100644 --- a/src/Log/Request.php +++ b/src/Log/Request.php @@ -41,11 +41,11 @@ public function behaviors(): array public function rules(): array { return [ - [['method', 'uri', 'headers', 'body',], 'required',], + [['method', 'uri', 'headers',], 'required',], [['method',], 'string', 'max' => 6,], [['method',], 'filter', 'filter' => 'mb_strtoupper',], [['uri',], 'string',], - [['headers',], 'each', 'rule' => ['each', 'rule' => 'string',],], + [['headers',], 'each', 'rule' => ['each', 'rule' => ['string'],],], [['body',], 'string',], ]; } diff --git a/src/Log/Response.php b/src/Log/Response.php index 136b284..2a83821 100644 --- a/src/Log/Response.php +++ b/src/Log/Response.php @@ -45,11 +45,11 @@ public function behaviors(): array public function rules(): array { return [ - [['http_request_id', 'status', 'headers', 'body',], 'required',], + [['http_request_id', 'status', 'headers',], 'required',], [['http_request_id',], 'exist', 'targetRelation' => 'request',], [['http_request_id',], 'unique',], [['status',], 'integer', 'min' => 100, 'max' => 599,], - [['headers',], 'each', 'rule' => ['each', 'rule' => 'string',],], + [['headers',], 'each', 'rule' => ['each', 'rule' => ['string'],],], [['body',], 'string',], ]; }