From 01a5990ef676e73ec00f75642253c025fba190b5 Mon Sep 17 00:00:00 2001 From: jansupol Date: Wed, 11 Oct 2023 22:58:16 +0200 Subject: [PATCH] Fixing servlet ResponseWriter#writeResponseStatusAndHeaders for error states Bug 5279 Signed-off-by: jansupol --- .../org/glassfish/jersey/servlet/internal/ResponseWriter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java index e7285ccb7b..38301f898a 100644 --- a/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java +++ b/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -125,7 +125,7 @@ public OutputStream writeResponseStatusAndHeaders(final long contentLength, fina // the invocation of sendError as on some Servlet implementations // modification of the response headers will have no effect // after the invocation of sendError. - final MultivaluedMap headers = getResponseContext().getStringHeaders(); + final MultivaluedMap headers = responseContext.getStringHeaders(); for (final Map.Entry> e : headers.entrySet()) { final Iterator it = e.getValue().iterator(); if (!it.hasNext()) {