public class SecurityHeaderBuilder extends Object
| Constructor and Description |
|---|
SecurityHeaderBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static void | addSecurityHeaders(Map<String,List<String>> headers,
String mimeType)Adds all appropriate security headers to a response. |
static void | filterCacheControlHeaders(Map<String,List<String>> headers)Filters Cache-Control headers to remove problematic values. |
static void | filterSetCookieHeaders(Map<String,List<String>> headers)Filters Set-Cookie headers to remove unwanted cookies. |
public static void addSecurityHeaders(Map<String,List<String>> headers, String mimeType)
headers - the HTTP response headers map to modifymimeType - the MIME type of the response content; may be nullpublic static void filterCacheControlHeaders(Map<String,List<String>> headers)
This method removes "none" and "post-check" values from Cache-Control headers, as these can cause issues with I2P HTTP proxying.
headers - the HTTP response headers mappublic static void filterSetCookieHeaders(Map<String,List<String>> headers)
This method removes Set-Cookie headers containing specific strings (STYXKEY, visited=yes) that are known to be irrelevant or unwanted for I2P HTTP proxying.
headers - the HTTP response headers map