brooklyncentral/brooklyn — pull request #1353 by Nakomis (2014-05-01 13:58:13+00:00)
Title: Added Integration test for testing redirect to absolute URL, fixed nginx controller SERVICE_UP issue

Added the following to Hello.java (in hello-world.war):
String requestUrl = new String(request.getRequestURL());
if (requestUrl.endsWith("/hello/redirect")) {
response.setStatus(307);
response.addHeader("Location", "/hello");
return;
}
if (requestUrl.endsWith("/hello/redirectAbsolute")) {
response.setStatus(307);
response.addHeader("Location", "http://" + request.getServerName() + ":" + request.getLocalPort() + "/hello");
return;
}