Skip to content

Commit

Permalink
fix ParamFrom::Header 大小写问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Aug 20, 2024
1 parent b9a04e0 commit 48a4c17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Attributes/Param.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ public function parsedValue(?ServerRequestInterface $request = null)
break;
}
case ParamFrom::HEADER:{
$data = $request->getHeader($this->name);
//swoole header的key,全部都是小写
$data = $request->getHeader(strtolower($this->name));
$this->hasSet = true;
if(!empty($data)){
$this->value = $data[0];
Expand Down
2 changes: 1 addition & 1 deletion src/Enum/ParamFrom.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum ParamFrom
case DI;
case CONTEXT;
case COOKIE;
case HEADER;
case HEADER;//swoole header的key,全部都是小写
case ROUTER_PARAMS;

public function toString():string
Expand Down

0 comments on commit 48a4c17

Please sign in to comment.