aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/container/handler/FilterBackingRequestHandler.java
blob: b83a1e61ab5244f4d646c7d13e204c5647a6b592 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.handler;

import com.yahoo.component.annotation.Inject;
import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
import com.yahoo.restapi.ErrorResponse;

import java.util.concurrent.Executor;

/**
 * Dummy handler for paths that should be handled in a request filter.
 *
 * @author freva
 */
public class FilterBackingRequestHandler extends ThreadedHttpRequestHandler {

    @Inject
    public FilterBackingRequestHandler(Executor executor) {
        super(executor);
    }

    @Override
    public HttpResponse handle(HttpRequest request) {
        log.warning("Expected " + request.getMethod() + " request to " + request.getUri().getRawPath() +
                " have been handled by a request filter");
        return ErrorResponse.internalServerError("No handler for this path");
    }

}