private String formatHeader ( ) { final StringBuilder sb = new StringBuilder ( ) ; getStringFromValue ( sb , "default-src" , defaultSrc ) ; getStringFromValue ( sb , "script-src" , scriptSrc ) ; getStringFromValue ( sb , "style-src" , styleSrc ) ; getStringFromValue ( sb , "img-src" , imgSrc ) ; getStringFromValue ( sb , "connect-src" , connectSrc ) ; getStringFromValue ( sb , "font-src" , fontSrc ) ; getStringFromValue ( sb , "object-src" , objectSrc ) ; getStringFromValue ( sb , "media-src" , mediaSrc ) ; getStringFromValue ( sb , "frame-src" , frameSrc ) ; getStringFromValue ( sb , "sandbox" , sandbox ) ; getStringFromValue ( sb , "report-uri" , reportUri ) ; getStringFromValue ( sb , "child-src" , childSrc ) ; getStringFromValue ( sb , "form-action" , formAction ) ; getStringFromValue ( sb , "frame-ancestors" , frameAncestors ) ; getStringFromValue ( sb , "plugin-types" , pluginTypes ) ; return sb . toString ( ) . replaceAll ( "(\\[|\\])" , "" ) . trim ( ) ; }
Formats a CSP header