From 0848a59cf9c8180dd986adb8fc1077ceed44eaa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20No=C3=ABl?= Date: Mon, 28 Aug 2017 10:34:22 +0200 Subject: [PATCH] pac4j expects to replace in setResponseHeader This fixes a bug with central logout where the location header was set twice for example. --- src/main/java/org/pac4j/jax/rs/pac4j/JaxRsContext.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/pac4j/jax/rs/pac4j/JaxRsContext.java b/src/main/java/org/pac4j/jax/rs/pac4j/JaxRsContext.java index 13b83ef..6587d07 100644 --- a/src/main/java/org/pac4j/jax/rs/pac4j/JaxRsContext.java +++ b/src/main/java/org/pac4j/jax/rs/pac4j/JaxRsContext.java @@ -84,6 +84,8 @@ public void setResponseStatus(int code) { @Override public void setResponseHeader(String name, String value) { + // header() adds headers, so we must remove the previous value first + getAbortBuilder().header(name, null); getAbortBuilder().header(name, value); }