[wp-trac] [WordPress Trac] #38521: REST API: Get rid of the `/users/me` redirect

WordPress Trac noreply at wordpress.org
Fri Oct 28 02:03:57 UTC 2016


#38521: REST API: Get rid of the `/users/me` redirect
--------------------------------------+--------------------------
 Reporter:  jnylen0                   |       Owner:  rachelbaker
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  4.7
Component:  REST API                  |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+--------------------------

Comment (by jnylen0):

 Here is a comparison of what several different types of client will
 experience under each option being discussed:
 https://docs.google.com/spreadsheets/d/1fSP8lNrq4DEx1LtlHOFh5Qr0SFlo7Q-
 smtPm6SmDbdk/edit

 Client types:

 - external client written in JS
 - external client not written in JS
 - internal client written in JS

 Options:

 - revert to redirect (`/users/me` → `/users/:id`)
 - use `_links` as pointer to correct resource
 - add POST/DELETE `/users/me`

 The key reason I'm pushing for this change is that under the redirect
 behavior, existing clients will "experience unexpected breakage in at
 least 2 ways (redirects not allowed with CORS+preflight; oauth1 requires
 re-signing)".

 While it is true that `_envelope` is a workaround for this behavior, in
 order to find that out, first you have to dig through Google/specs to
 figure out what is going on.  Nobody wants to do that: APIs should make
 life easy for their consumers and the rest of the code that needs to
 interoperate with them.  Therefore, in my opinion this decision should be
 made based on minimizing the expected number of future frustrated
 developer-hours.

 The argument for leaving the redirect in place is for resource purity: a
 given REST resource will now be available at 2 different URLs.  I'm not
 aware of any long-term practical consequences for this impurity.

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


More information about the wp-trac mailing list