Trim url pattern

This helps support whitespaces between METHOD and URL:
```php
Flight::route('GET  /auth/nonce',            array($apiAuth, 'getNonce')); // `GET[space][space]/auth/nonce`
Flight::route('POST /auth/login/email',     array($apiAuth, 'loginByEmail'));
```
pull/409/head
pluveto 5 years ago committed by GitHub
parent e459a54017
commit ddb806a604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -64,7 +64,7 @@ class Router {
if (strpos($pattern, ' ') !== false) { if (strpos($pattern, ' ') !== false) {
list($method, $url) = explode(' ', trim($pattern), 2); list($method, $url) = explode(' ', trim($pattern), 2);
$url = trim($url);
$methods = explode('|', $method); $methods = explode('|', $method);
} }

Loading…
Cancel
Save