Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'feature/fix-broken-route-by-method' into develop

  • Loading branch information...
commit 7fe110656d39f24e9696ef08c27a6e0f98ded992 2 parents 611baa3 + 711f479
@trq trq authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/Proem/Routing/Route/Standard.php
View
11 lib/Proem/Routing/Route/Standard.php
@@ -116,12 +116,17 @@ public function process(Request $request)
$rule = $this->options['rule'];
$target = isset($this->options['targets']) ? $this->options['targets'] : [];
$custom_filters = isset($this->options['filters']) ? $this->options['filters'] : [];
- $method = isset($this->options['method']) ? $this->options['method'] : 'GET';
+ $method = isset($this->options['method']) ? $this->options['method'] : false;
+
+ $requestMethod = $request->getMethod();
+
+ if ($method && (strtoupper($method) !== strtoupper($requestMethod))) {
+ return false;
+ }
$default_tokens = $this->default_tokens;
$default_filters = $this->default_filters;
$uri = $request->getRequestUri();
- $requestMethod = $request->getMethod();
$keys = [];
$values = [];
@@ -150,7 +155,7 @@ function($matches) use ($custom_filters, $default_tokens, $default_filters)
$rule
) . '/?';
- if (preg_match('@^' . $regex . '$@', $request->getRequestUri(), $values) && $requestMethod == $method) {
+ if (preg_match('@^' . $regex . '$@', $request->getRequestUri(), $values)) {
array_shift($values);
foreach ($keys as $index => $value) {
Please sign in to comment.
Something went wrong with that request. Please try again.