Make rest.php return HTTP redirects with relative URLs in the Location header. This ensures interoperability with the WMF service mesh, avoiding issues with internal services trying to resolve redirects by accessing the canonical external URLs.
Note that relative URLs are allowed in the Location header per RFC 7231, while the obsolete RFC 2616 required it to be absolute (until 2014). It seems like we can expect clients that use our REST API to conform to the new standard.
From a brief conversation with the Traffic team, there are no immediate concerns. We do have some Varnish rules related to redirects though, which we should be mindful of. E.g.: