From e77765fab39532d40e3afbe6287fc4b349e89950 Mon Sep 17 00:00:00 2001 From: KevinClair Date: Tue, 7 Nov 2023 22:39:28 +0800 Subject: [PATCH] Fix duplicate request headers are added(#244) --- src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java b/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java index 41b2983..6a30945 100755 --- a/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java +++ b/src/main/java/org/mitre/dsmiley/httpproxy/ProxyServlet.java @@ -562,6 +562,8 @@ protected void copyResponseHeader(HttpServletRequest servletRequest, String headerName = header.getName(); if (hopByHopHeaders.containsHeader(headerName)) return; + if (servletResponse.containsHeader(headerName)) + return; String headerValue = header.getValue(); if (headerName.equalsIgnoreCase(org.apache.http.cookie.SM.SET_COOKIE) || headerName.equalsIgnoreCase(org.apache.http.cookie.SM.SET_COOKIE2)) {