[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
Mon May 22 18:19:48 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:  Awaiting Review
 Priority:  normal       |     Version:  4.4
Component:  REST API     |  Resolution:
 Severity:  major        |     Focuses:  administration, multisite, rest-
 Keywords:  https        |  api
-------------------------+-------------------------------------------------

Comment (by jnylen0):

 [attachment:36451.2.diff] is a lot like what I had in mind, though I think
 we should skip the hostname check for this case, as even if the hostnames
 are different, we still need to force the API to SSL.

 Replying to [comment:21 westonruter]:
 > On the other hand, what if in the admin we opt to use `get_site_url(
 $site_id, $prefix, 'admin' )` instead of `get_home_url( … )`? Then we'd
 know for sure that the domain would be the same and so HTTPS would be
 assured to work.

 I am hesitant to make this larger change, maybe it should have been that
 way from the beginning but it seems like we shouldn't assume that these
 domains are the same.

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


More information about the wp-trac mailing list