This commit is contained in:
2020-09-08 01:01:58 +08:00
parent d84ceaa353
commit 26d81cd8bc
2 changed files with 9 additions and 10 deletions
+6 -2
View File
@@ -115,11 +115,15 @@ class HttpHeaders
/**
* @param $name
* @param null $default
* @return mixed|string|null
*/
public function get($name)
public function get($name, $default = null)
{
return $this->getHeader($name);
if (empty($value = $this->getHeader($name))) {
return $default;
}
return $value;
}