mirror of
https://github.com/google/nomulus
synced 2026-02-03 11:32:24 +00:00
Send a plaintext link to the mapreduce console in fluent style
The link was previously being sent using a JS redirect, which doesn't work because the endpoints that trigger mapreduces can only be hit from the command line (because they require auth). This commit switches the link to be in plaintext and renders the full URL instead of just the path, so that clicking it directly from the terminal works. This also improves how these links are sent from callsites by using a fluent style. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=228764606
This commit is contained in:
@@ -23,10 +23,6 @@ import org.joda.time.DateTime;
|
||||
/** HTTP response object. */
|
||||
public final class ResponseImpl implements Response {
|
||||
|
||||
/** Code for a JavaScript redirect. */
|
||||
private static final String REDIRECT_PAYLOAD_FORMAT =
|
||||
"<script>window.location.replace(\"%1$s\");</script><a href=\"%1$s\">%1$s</a>";
|
||||
|
||||
private final HttpServletResponse rsp;
|
||||
|
||||
@Inject
|
||||
@@ -62,9 +58,4 @@ public final class ResponseImpl implements Response {
|
||||
public void setDateHeader(String header, DateTime timestamp) {
|
||||
rsp.setDateHeader(header, timestamp.getMillis());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendJavaScriptRedirect(String redirectUrl) {
|
||||
setPayload(String.format(REDIRECT_PAYLOAD_FORMAT, redirectUrl));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user