Treat redirects as success when checking for documentation
Documentation may be served elsewhere due to a strange reverse proxy configuration or authentication setup. Assume that a 301 or 302 response for Documentation/index.html indicates documentation is present. Change-Id: I07cfe8fc1721aeb3be690051b94517c22a08c5cd
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user