mirror of
https://github.com/google/nomulus
synced 2026-02-04 12:02:30 +00:00
Daggerize/Actionize the load snapshot servlet
This is needed to eliminate the last non-injected use of BigqueryFactory. It gets rid of the deprecated HttpServletUtils now that we don't have lots of separate servlets, and changes the check snapshot servlet's usage of such. It also fixes up some related minor style issues in the update snapshot action (and its injectable parameters). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=120547998
This commit is contained in:
@@ -17,9 +17,9 @@ package com.google.domain.registry.request;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Strings.nullToEmpty;
|
||||
import static com.google.common.net.HttpHeaders.LOCATION;
|
||||
import static com.google.common.net.MediaType.PLAIN_TEXT_UTF_8;
|
||||
import static com.google.domain.registry.security.XsrfTokenManager.X_CSRF_TOKEN;
|
||||
import static com.google.domain.registry.security.XsrfTokenManager.validateToken;
|
||||
import static com.google.domain.registry.util.HttpServletUtils.sendOk;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_METHOD_NOT_ALLOWED;
|
||||
import static javax.servlet.http.HttpServletResponse.SC_MOVED_TEMPORARILY;
|
||||
@@ -149,7 +149,8 @@ public final class RequestHandler<C> {
|
||||
try {
|
||||
route.get().instantiator().apply(component).run();
|
||||
if (route.get().action().automaticallyPrintOk()) {
|
||||
sendOk(rsp);
|
||||
rsp.setContentType(PLAIN_TEXT_UTF_8.toString());
|
||||
rsp.getWriter().write("OK\n");
|
||||
}
|
||||
} catch (HttpException e) {
|
||||
e.send(rsp);
|
||||
|
||||
Reference in New Issue
Block a user