jersey/jersey — pull request #51 by stain (2014-01-02 17:34:06+00:00)
Title: JERSEY-1611 Propagate redirected URL

See https://java.net/jira/browse/JERSEY-1611

This adds the getUri() method to ClientResponse which contains
the final URL after following any redirections. This will differ
from the getClientRequest().getUri() if the client has followed
any redirections.

The test verifies this by changing the getURL() in the
wrapped HttpUrlConnection.

ClientResponse.getLinks() has been updated to use the correct
base URL (getUri()) after redirection - however note that strictly
speaking (RFC2616) the Links should also be resolved according to
the Content-Location header, if present. (this is a separate bug).

In case ClientResponse.setUri() has not been set (constructed
outside of HttpUrlConnector) , getUri returns the
requested URI from getClientRequest().getUri() (e.g. getLinks() would
behave as before).