From fdb54fa2fb3e5099a736d19af144dc474cc80c4b Mon Sep 17 00:00:00 2001 From: gregw Date: Tue, 23 Feb 2021 13:06:50 +0100 Subject: [PATCH] Efficiency improvements for #5977 Improve efficiency for non wrapped response for cache-contro --- .../main/java/org/eclipse/jetty/server/ResourceService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java index 8ece91dc2f5b..1b85ead9665c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceService.java @@ -836,10 +836,10 @@ protected void putHeaders(HttpServletResponse response, HttpContent content, lon r.putHeaders(content, contentLength, _etags); HttpFields fields = r.getHttpFields(); if (_acceptRanges && !fields.contains(HttpHeader.ACCEPT_RANGES)) - fields.put(ACCEPT_RANGES); + fields.add(ACCEPT_RANGES); if (_cacheControl != null && !fields.contains(HttpHeader.CACHE_CONTROL)) - fields.put(_cacheControl); + fields.add(_cacheControl); } else {