Page MenuHomePhabricator

Move redirect handling from mobile service to RESTBase
Closed, ResolvedPublic

Description

We've recently implemented following redirects in RESTBase, so the redirect logic can be removed from the app service.

The redirect handling logic in RESTBase is the following:

  1. If the requested page is for mediawiki redirect, return 302 with a location header pointing to the redirect target, and return the original content for a redirect page in the body.
  2. If redirect=false query parameter is set, return normal response for redirected page.

So, on mobile part there're several pieces to check/tweak/ensure working:

  1. The app should follow redirects, but as from now on the redirect loop handling will be done on the client we need to ensure that redirect following is limited in the app. @bearND have checked that, and currently the redirect loop page produces an 400 Unknown Error message in the app.
  2. The service should not parse and follow redirects any more, so the corresponding code should be deleted. Although the mobile service could be reached for pregeneration on redirect pages (until we switch to a more granular change propagation), so the content service at least should not fail with errors when running on redirect pages. It could return nothing if a redirect is encountered and just abort the execution, returning a 200.

Event Timeline

bearND claimed this task.

deployed on Monday, 5/9/2016