Skip to content

Commit

Permalink
Fix error in Route - accapt end with /
Browse files Browse the repository at this point in the history
  • Loading branch information
honzapospi committed Oct 8, 2016
1 parent 131883f commit 19596ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 104 deletions.
2 changes: 2 additions & 0 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Route extends \Nette\Object implements IRoute {
const SPLITTER = '_______';

public function __construct($pathPattern, $method, $className){
$pathPattern = rtrim($pathPattern, '/');
$this->pathPattern = $pathPattern;
preg_match_all('#\<[a-zA-Z0-9]+\>#', $pathPattern, $matches);
$vars = $matches[0];
Expand All @@ -40,6 +41,7 @@ public function __construct($pathPattern, $method, $className){
* @return string ClassName is success, false otherwise.
*/
public function match($path, $method) {
$path = rtrim($path, '/');
if($this->method == self::ALL || $method == $this->method || $method == self::OPTIONS){
if($this->pathPattern == '*'){
if($method == self::OPTIONS)
Expand Down
83 changes: 0 additions & 83 deletions tests/Mock/MockHttpRequest.php

This file was deleted.

21 changes: 0 additions & 21 deletions tests/TestRenderer.php

This file was deleted.

0 comments on commit 19596ae

Please sign in to comment.