Skip to content

Commit

Permalink
Fix Request and Response validation rules for body and headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Horat1us committed Nov 21, 2018
1 parent 6176b00 commit 3385948
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Log/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',],
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/Log/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',],
];
}
Expand Down

0 comments on commit 3385948

Please sign in to comment.