[wp-trac] [WordPress Trac] #36451: get_rest_url() not returning SSL version of the URL when the home_url it's a subdomain

WordPress Trac noreply at wordpress.org
Wed May 24 00:51:56 UTC 2017


#36451: get_rest_url() not returning SSL version of the URL when the home_url it's
a subdomain
-------------------------+-------------------------------------------------
 Reporter:  nicholas_io  |       Owner:  johnbillion
     Type:  defect       |      Status:  assigned
  (bug)                  |   Milestone:  4.8
 Priority:  normal       |     Version:  4.4
Component:  REST API     |  Resolution:
 Severity:  major        |     Focuses:  administration, multisite, rest-
 Keywords:  https        |  api
-------------------------+-------------------------------------------------

Comment (by johnbillion):

 The original discussion linked in #34299 has some importance:
 https://github.com/WP-API/WP-API/issues/259

 The REST API endpoint URL is not blindly forced to HTTPS if the current
 request is HTTPS because the domain name can differ and not be available
 over HTTPS, therefore breaking the endpoint.

 That said, the current situation results in the REST API endpoint URL
 having an HTTP scheme when you're on an HTTPS URL, which means it's most
 likely broken due to cross-protocol restrictions in browsers anyway.

 I think we could go ahead and force the REST API endpoint URL to HTTPS
 according to [attachment:36451.3.diff], but I don't want to do that during
 beta 2. I think this needs to be punted to 4.9 early.

 ----

 @nicholas_io @igmoweb @siboulet For your specific cases, the
 [https://developer.wordpress.org/reference/hooks/rest_url/ rest_url filter
 can be used to fix the URL].

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36451#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list