aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc-cloud-aws
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2021-01-29 14:34:55 +0100
committerØyvind Grønnesby <oyving@verizonmedia.com>2021-01-29 14:34:55 +0100
commiteb4963dbcf55df7f507736e854adc732dabaedd0 (patch)
treecdbf09fcdae79d1fda7f4776804ca13641cbd1d4 /jdisc-cloud-aws
parentf4b4812bf7f19e193bf3dc89764a86f4e5752347 (diff)
Remove GET handling in handler
Diffstat (limited to 'jdisc-cloud-aws')
-rw-r--r--jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/AwsParameterStoreValidationHandler.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/AwsParameterStoreValidationHandler.java b/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/AwsParameterStoreValidationHandler.java
index f1d8249d059..195b35d4912 100644
--- a/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/AwsParameterStoreValidationHandler.java
+++ b/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/AwsParameterStoreValidationHandler.java
@@ -42,21 +42,16 @@ public class AwsParameterStoreValidationHandler extends LoggingRequestHandler {
@Override
public HttpResponse handle(HttpRequest request) {
try {
- switch (request.getMethod()) {
- case GET: return handleGET();
- case POST: return handlePOST(request);
- default: return ErrorResponse.methodNotAllowed("Method '" + request.getMethod() + "' is not supported");
+ if (request.getMethod() == com.yahoo.jdisc.http.HttpRequest.Method.POST) {
+ return handlePOST(request);
}
+ return ErrorResponse.methodNotAllowed("Method '" + request.getMethod() + "' is not supported");
} catch (RuntimeException e) {
log.log(Level.WARNING, "Unexpected error handling '" + request.getUri() + "'", e);
return ErrorResponse.internalServerError(Exceptions.toMessageString(e));
}
}
- private HttpResponse handleGET() {
- return new SlimeJsonResponse();
- }
-
private HttpResponse handlePOST(HttpRequest request) {
var json = toSlime(request.getData());
var settings = AwsSettings.fromSlime(json);