apify/apify-library — Issue #13: Request::getUrlPath returns wrong value
Author: elvetemedve
Created: 2012-02-09 20:24:45+00:00
State: open

If you use Request::setUrlKeyword or Request::setUrlSegment without Request::enableRestfulMapping, than Request::getUrlPath will return the full URI strarting from webroot instead of the expected suffix.

```php
setUrlKeyword('api'); // we want the part after the "api" segment
$request->enableUrlRewriting();
$request->addRoutes(include ROOT_DIR.'/config/routes.php');
$request->dispatch();
} catch (Exception $e) {
$request->handleException($e);
}
```
Request:

```
GET /apify/api/users
```

Expected result:

* controller/action: users/index
* $request->getUrlPath(): "users"

Actual result:

* controller/action: index/index
* $request->getUrlPath(): "apify/api/users"