org.apache.struts2.interceptor.csp

## Class DefaultCspSettings

- java.lang.Object
- - org.apache.struts2.interceptor.csp.DefaultCspSettings

- All Implemented Interfaces:
    CspSettings

      public class DefaultCspSettings
      extends Object
      implements CspSettings

  Default implementation of `CspSettings`. The default policy implements strict CSP with a nonce based approach and follows the guide: https://csp.withgoogle.com/docs/index.html/
  See Also:
    `CspSettings`, `CspInterceptor`

- - ### Field Summary

    - ### Fields inherited from interface org.apache.struts2.interceptor.csp.CspSettings

      `BASE_URI, CSP_ENFORCE_HEADER, CSP_REPORT_HEADER, CSP_REPORT_TYPE, HTTP, HTTPS, NONCE_RANDOM_LENGTH, NONE, OBJECT_SRC, REPORT_URI, SCRIPT_SRC, STRICT_DYNAMIC`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultCspSettings()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCspHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
    `void` | `addCspHeaders(javax.servlet.http.HttpServletResponse response)`
    `void` | `setEnforcingMode(boolean enforcingMode)`
    `void` | `setReportUri(String reportUri)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultCspSettings

          public DefaultCspSettings()

  - ### Method Detail

    - #### addCspHeaders

          public void addCspHeaders(javax.servlet.http.HttpServletResponse response)

      Specified by:
        `addCspHeaders` in interface `CspSettings`

    - #### addCspHeaders

          public void addCspHeaders(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)

      Specified by:
        `addCspHeaders` in interface `CspSettings`

    - #### setEnforcingMode

          public void setEnforcingMode(boolean enforcingMode)

      Specified by:
        `setEnforcingMode` in interface `CspSettings`

    - #### setReportUri

          public void setReportUri(String reportUri)

      Specified by:
        `setReportUri` in interface `CspSettings`

Copyright © 2000–2022 Apache Software Foundation. All rights reserved.