-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
Allow for protocol in canonical
setting in config.yml. fixes #3040.
#3044
Allow for protocol in canonical
setting in config.yml. fixes #3040.
#3044
Conversation
{ | ||
$canonical = $app['config']->get('general/canonical', ""); | ||
$this->setRequest("canonical", $canonical); | ||
$canonical = parse_url($app['config']->get('general/canonical', "")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure parse_url will fail if you don't include http(s)://
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, works just fine. $canonical['scheme']
will just be unset.
Is there a point to have |
I debated that internally, but i just wanted to fix the bug, not do refactorings. Small as they might be. |
Fair point. I'll just be over here in my corner twitching
|
Ok, ok, i'll put those two functions together. ;-) |
$canonical['host'] = $request->server->get('HTTP_HOST'); | ||
} | ||
|
||
$this->setRequest("canonical", sprintf("%s://%s", $canonical['scheme'], $canonical['host'])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about base paths? Or does UrlGenerator account for base paths?
@CarsonF I've tested them, and they work fine. Let's say i have this:
Notice the difference in these screenshots below, yet they both give the same (correct) canonical: |
Allow for protocol in `canonical` setting in config.yml. fixes #3040.
No description provided.