Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass optional path when needed. So if a path is localhost/hello-web/publ... #84

Closed
wants to merge 1 commit into from

Conversation

harikt
Copy link
Member

@harikt harikt commented Apr 19, 2015

...ic/hello/world . The real path to check is hello/world and not the whole path

…ublic/hello/world . The real path to check is hello/world and not the whole path
@pmjones
Copy link
Member

pmjones commented Apr 19, 2015

In theory, the Request will have been modified beforehand so that the path is "correct."

@pmjones
Copy link
Member

pmjones commented Jun 15, 2015

After trying this PR, and one of my own, I've come to the conclusion that this is best handled by modifying the Request before passing it to the Router, likely via a middleware piece. That gives you full control over how the prefix is handled. E.g.:

function ($request, $response, $next) {
    $uri = $request->getUri();
    $path = substr($uri->getPath(), strlen('/hello-web/public'));
    $uri = $uri->withPath($path);
    $request = $request->withUri($uri);
    return $next($request, $response);
}

@pmjones pmjones closed this Jun 15, 2015
@harikt harikt deleted the match branch June 15, 2015 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants