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

Allow for protocol in canonical setting in config.yml. fixes #3040. #3044

Merged
merged 6 commits into from
Mar 7, 2015
Merged

Allow for protocol in canonical setting in config.yml. fixes #3040. #3044

merged 6 commits into from
Mar 7, 2015

Conversation

bobdenotter
Copy link
Member

No description provided.

{
$canonical = $app['config']->get('general/canonical', "");
$this->setRequest("canonical", $canonical);
$canonical = parse_url($app['config']->get('general/canonical', ""));
Copy link
Member

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)://

Copy link
Member Author

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.

@CarsonF
Copy link
Member

CarsonF commented Mar 6, 2015

Is there a point to have initializeApp and initializeRequest separate with this change? They are both doing the same type of logic.

@bobdenotter
Copy link
Member Author

Is there a point to have initializeApp and initializeRequest separate with this change?

I debated that internally, but i just wanted to fix the bug, not do refactorings. Small as they might be.

@CarsonF
Copy link
Member

CarsonF commented Mar 6, 2015

Fair point. I'll just be over here in my corner twitching
On Mar 6, 2015 1:23 PM, "Bob den Otter" notifications@github.com wrote:

Is there a point to have initializeApp and initializeRequest separate with
this change?

I debated that internally, but i just wanted to fix the bug, not do
refactorings. Small as they might be.


Reply to this email directly or view it on GitHub
#3044 (comment).

@bobdenotter
Copy link
Member Author

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']));
Copy link
Member

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?

@bobdenotter
Copy link
Member Author

@CarsonF I've tested them, and they work fine. Let's say i have this:

canonical: 'https://example.org'

Notice the difference in these screenshots below, yet they both give the same (correct) canonical:

screenshot 2015-03-06 20 36 59

screenshot 2015-03-06 20 37 19

@GwendolenLynch
Copy link
Contributor

:shipit:

GwendolenLynch added a commit that referenced this pull request Mar 7, 2015
Allow for protocol in `canonical` setting in config.yml. fixes #3040.
@GwendolenLynch GwendolenLynch merged commit 20c8897 into bolt:master Mar 7, 2015
@bobdenotter bobdenotter deleted the fix/canonical-protocol branch March 7, 2015 08:14
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.

3 participants