Skip to content

Commit

Permalink
Add on null Or Empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mohityadav766 committed Oct 25, 2024
1 parent 2ab04d4 commit c0cefba
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.openmetadata.service.exception;

import static org.openmetadata.common.utils.CommonUtil.nullOrEmpty;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -91,10 +93,14 @@ public static void setSecurityHeader(
webConfiguration.getPermissionPolicyHeaderFactory().build().forEach(response::setHeader);

// Cache-Control
response.setHeader(CACHE_CONTROL_HEADER, webConfiguration.getCacheControl());
if (!nullOrEmpty(webConfiguration.getCacheControl())) {
response.setHeader(CACHE_CONTROL_HEADER, webConfiguration.getCacheControl());
}

// Pragma
response.setHeader(PRAGMA_HEADER, webConfiguration.getPragma());
if (!nullOrEmpty(webConfiguration.getPragma())) {
response.setHeader(PRAGMA_HEADER, webConfiguration.getPragma());
}

// Additional Headers
webConfiguration.getHeaders().forEach(response::setHeader);
Expand Down

0 comments on commit c0cefba

Please sign in to comment.