aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/test/java/com/yahoo/jdisc/http/filter/ResponseHeaderFilter.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-core/src/test/java/com/yahoo/jdisc/http/filter/ResponseHeaderFilter.java')
-rw-r--r--container-core/src/test/java/com/yahoo/jdisc/http/filter/ResponseHeaderFilter.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/container-core/src/test/java/com/yahoo/jdisc/http/filter/ResponseHeaderFilter.java b/container-core/src/test/java/com/yahoo/jdisc/http/filter/ResponseHeaderFilter.java
new file mode 100644
index 00000000000..3855c3a494b
--- /dev/null
+++ b/container-core/src/test/java/com/yahoo/jdisc/http/filter/ResponseHeaderFilter.java
@@ -0,0 +1,25 @@
+// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.jdisc.http.filter;
+
+import com.yahoo.jdisc.AbstractResource;
+import com.yahoo.jdisc.Request;
+import com.yahoo.jdisc.Response;
+
+/**
+ * @author Simon Thoresen Hult
+ */
+public class ResponseHeaderFilter extends AbstractResource implements ResponseFilter {
+
+ private final String key;
+ private final String val;
+
+ public ResponseHeaderFilter(String key, String val) {
+ this.key = key;
+ this.val = val;
+ }
+
+ @Override
+ public void filter(Response response, Request request) {
+ response.headers().add(key, val);
+ }
+}