[wp-trac] [WordPress Trac] #30371: Allow for // rooted URLs in http request() calls (wp_remote_get(), etc)

WordPress Trac noreply at wordpress.org
Tue Nov 18 17:09:10 UTC 2014


#30371: Allow for // rooted URLs in http request() calls (wp_remote_get(), etc)
-------------------------+------------------------------
 Reporter:  dmchale      |       Owner:
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  HTTP API     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by dmchale):

 @dd32, I figure that if a developer is asking for a scheme-less URL they
 probably intend for the behavior to follow standard "stick with my current
 protocol" logic - I certainly did. Like you said, defaulting to HTTP
 obviously isn't optimal especially in cases where perhaps the endpoint
 only supports HTTPS - which, one could argue, is a good reason to not
 change a thing, and force the developer to specify https:// in their code.
 However, one could also argue that the developer hopefully knows the
 environment they are developing for and will only use this method of URI
 reference if/when it makes sense.

 As you put it, at least respecting the current request scheme has some
 logic to it. If someone asks for a url leading with `//`, we can at least
 try to do the best we can to honor that request in a way that seems to
 make sense rather than claiming it's an invalid url. :)

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


More information about the wp-trac mailing list