Skip to content

Sync: Add protocol to raw urls#7984

Merged
dereksmart merged 1 commit intomasterfrom
fix/http-https-protocol
Oct 17, 2017
Merged

Sync: Add protocol to raw urls#7984
dereksmart merged 1 commit intomasterfrom
fix/http-https-protocol

Conversation

@ebinnion
Copy link
Contributor

There's been an uptick in support tickets where connections are breaking after the site switches to https. This seems to have started with 5.2 or 5.3, likely when we deployed this PR:

#5852

In that PR, we began syncing the raw home/siteurl values from the DB or from the WP_HOME and WP_SITEURL constants. As part of that work, since we were no longer calling functions like get_home_url() which will set the protocol to https when is_ssl() is true, the https change wasn't getting picked up.

This PR should fix that by adding the is_ssl() check and setting the protocol to https if so.

To test:

  • Run tests

@ebinnion ebinnion added [Package] Sync [Status] Needs Review This PR is ready for review. [Type] Bug When a feature is broken and / or not performing as intended labels Oct 12, 2017
@ebinnion ebinnion added this to the 5.5 milestone Oct 12, 2017
@ebinnion ebinnion self-assigned this Oct 12, 2017
@ebinnion ebinnion requested review from enejb and gravityrail October 12, 2017 19:54
@ebinnion ebinnion requested a review from a team as a code owner October 12, 2017 19:54
@enejb
Copy link
Member

enejb commented Oct 12, 2017

@ebinnion can you explain when we sync those values. The problme that I see with this solution is that if the site has the value set in the DB but the user is able to visit the same site under both urls. https and http then the problem could still happen that the scheme is switching. (but I am not sure if the previous PR was trying to address that or not)
Maybe we could help the user somehow.

Ask them to set define('FORCE_SSL_ADMIN', true); to be true or something like that. Which would help redirect them to https if they are already visiting the site with that.

The code looks good and makes sense to me.

@ebinnion
Copy link
Contributor Author

We sync those values when we sync callables, which happens when the user visits wp-admin I believe.

The issue here isn't the protocol normalization, or that the value flip-flops. The issue is that the site isn't swapping from http to https at all. Likely because users are using methods such as htaccess or a redirect plugin, as opposed to updating the home/siteurl values in the database.

We could tell users to update the values in the db or the constant to have https, but I'm not sure that's practical since it still results in the user getting in touch with support and support then walking them through that.

Copy link
Contributor

@oskosk oskosk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dereksmart dereksmart merged commit 31f7850 into master Oct 17, 2017
@dereksmart dereksmart deleted the fix/http-https-protocol branch October 17, 2017 17:54
@dereksmart dereksmart removed the [Status] Needs Review This PR is ready for review. label Oct 17, 2017
@jeherve jeherve added [Status] Needs Changelog [Status] Needs Testing We need to add this change to the testing call for this month's release and removed [Status] Needs Changelog [Status] Needs Testing We need to add this change to the testing call for this month's release labels Oct 17, 2017
jeherve added a commit that referenced this pull request Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Sync [Pri] BLOCKER [Type] Bug When a feature is broken and / or not performing as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants