Making WordPress.org

Opened 18 months ago

Last modified 13 months ago

#3084 new defect

Translate API endless loop

Reported by: casiepa Owned by:
Milestone: Priority: normal
Component: Translate Site & Plugins Keywords:


https://translate.wordpress.org/api/projects/wp is responding correctly
https://translate.wordpress.org/api/projects is not

It seems to go in an endless loop and then ends with an ERR_TOO_MANY_REDIRECTS

Change History (3)

#1 @SergeyBiryukov
18 months ago

Looks like it redirects to /api/projects/ (note the trailing slash) and back to /api/projects until the limit is reached. I'm not familiar with the API part of GlotPress yet, but sounds like a bug to me :) It should either display the projects or show an error, but not fall into an endless redirect loop.

#2 @dd32
13 months ago

FWIW The redirect from /api/projects/ to /api/projects is being triggered by redirect_canonical().

I can't trigger the /api/projects to /api/projects/ in my development environment either, so I'm not sure what's up.

The /api/projects route definitely isn't one we want to allow to be loaded though, as it causes OOM errors. IIRC we may have even disabled it directly - @ocean90 do you recall anything about this one?

#3 @ocean90
13 months ago

The API routes for projects are not disabled, see https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php#L106. We probably should, /api/projects/wp-plugins is killing it.

I couldn't reproduce this on my sandbox neither last time I checked. So maybe there's another redirect rule (nginx) somewhere. By default all URLs should be without a trailing slash.

Note: See TracTickets for help on using tickets.