Added better header parsing to Request-class.

- Added `tryParse` argument to the `getHeader` method. When enabled the method will try to parse headers from both server and client-side (enabled by default).
- Simplified references that checks for both variants of header (http/non http).
- Simplified getIp method of the Request-class.
This commit is contained in:
Simon Sessingø
2021-03-22 11:14:22 +01:00
parent 0aeefa1cba
commit d2b3ea4f54
4 changed files with 33 additions and 20 deletions
+2 -2
View File
@@ -305,8 +305,8 @@ class Router
* Start the routing
*
* @return string|null
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
* @throws \Pecee\Http\Middleware\Exceptions\TokenMismatchException
* @throws NotFoundHttpException
* @throws TokenMismatchException
* @throws HttpException
* @throws \Exception
*/
+1 -1
View File
@@ -466,7 +466,7 @@ class SimpleRouter
/**
* Get the request
*
* @return \Pecee\Http\Request
* @return Request
*/
public static function request(): Request
{