Merge "Treat redirects as success when checking for documentation"

This commit is contained in:
Dave Borowitz 2015-07-09 20:58:36 +00:00 committed by Gerrit Code Review
commit c2e58d40f5

View File

@ -822,10 +822,15 @@ public class Gerrit implements EntryPoint {
req.setCallback(new RequestCallback() {
@Override
public void onResponseReceived(Request req, Response resp) {
if (resp.getStatusCode() == Response.SC_OK) {
cb.onSuccess(DocInfo.create());
} else {
cb.onSuccess(null);
switch (resp.getStatusCode()) {
case Response.SC_OK:
case Response.SC_MOVED_PERMANENTLY:
case Response.SC_MOVED_TEMPORARILY:
cb.onSuccess(DocInfo.create());
break;
default:
cb.onSuccess(null);
break;
}
}