Skip to content

Commit

Permalink
HBASE-28661 Fix compatibility issue in branch-2.x (#5988)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Purtell <apurtell@apache.org>
  • Loading branch information
szucsvillo authored Jun 14, 2024
1 parent d44a224 commit 42ecc23
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,27 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
public void destroy() {
}

/**
* @param conf configuration
* @param isSecure use secure defaults if 'true'
* @return default parameters, as a map
*/
public static Map<String, String> getDefaultParameters(Configuration conf, boolean isSecure) {
Map<String, String> params = new HashMap<>();
params.put("hsts", conf.get("hbase.http.filter.hsts.value", isSecure ? DEFAULT_HSTS : ""));
params.put("csp", conf.get("hbase.http.filter.csp.value", isSecure ? DEFAULT_CSP : ""));
return params;
}

/**
* @param conf configuration
* @return default parameters, as a map
* @deprecated Use {@link SecurityHeadersFilter#getDefaultParameters(Configuration, boolean)}
* instead.
*/
@Deprecated
public static Map<String, String> getDefaultParameters(Configuration conf) {
return getDefaultParameters(conf, false);
}

}

0 comments on commit 42ecc23

Please sign in to comment.