Skip to content

Commit

Permalink
fix: api base URLs in config may end with '/' or may not (i.e. '/api' or
Browse files Browse the repository at this point in the history
'/api/' or '/')
  • Loading branch information
stefanorosanelli committed Mar 2, 2016
1 parent 7ddc8d4 commit daf364d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ Enable API on old frontend app
$apiBaseUrl = Configure::read('api.baseUrl');
if (!empty($apiBaseUrl) && is_string($apiBaseUrl)) {
Router::connect($apiBaseUrl . '/*', array('controller' => 'api', 'action' => 'route'));
$apiBaseUrl .= (substr($apiBaseUrl, -1) === '/') ? '*' : '/*';
Router::connect($apiBaseUrl, array('controller' => 'api', 'action' => 'route'));
}
above
Expand Down

0 comments on commit daf364d

Please sign in to comment.