Only force https REST API URLs on Go environments #418

Merged
merged 1 commit into from Jan 4, 2017

Projects

None yet

2 participants

@mjangda
Member
mjangda commented Jan 3, 2017

It's awkward to disable locally since you need local modifications to mu-plugins, which makes updates a pain. Only add the filter when we are in a Go-server environment (i.e. VIP_GO_ENV !== false) to make this easier.

misc.php
*/
-add_filter( 'rest_url', '_vip_filter_rest_url_for_ssl' );
+if ( defined( 'VIP_GO_ENV' ) && false !== VIP_GO_ENV ) {
@nickdaugherty
nickdaugherty Jan 4, 2017 edited Member

The better constant to use would be WPCOM_IS_VIP_ENV - VIP_GO_ENV is intended to identify the environment name of the site, such as production, preprod, develop, etc...rather than indicate if the site is hosted in a VIP environment or not.

Currently VIP_GO_ENV is being used as a replacement for WPCOM_IS_VIP_ENV in a few spots (and gets set to false in local environments) but I'd like to see us use it purely for environment identification rather than to identify where the code is running.

@mjangda
mjangda Jan 4, 2017 Member

That sounds reasonable. Updated.

@mjangda mjangda Only force https REST API URLs on Go environments
It's awkward to disable locally since you need local modifications to
mu-plugins, which makes updates a pain. Only add the filter when we are
in a Go-server environment (i.e. WPCOM_IS_VIP_ENV === true) to make this
easier.
f93680b
@mjangda mjangda removed the has feedback label Jan 4, 2017
@mjangda mjangda merged commit c85265c into master Jan 4, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@mjangda mjangda deleted the fix/no-https-wp-api-on-local branch Jan 4, 2017
@mjangda
Member
mjangda commented Jan 4, 2017

r86386-deploy

@mjangda mjangda added deployed and removed deployed labels Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment