Class ContentSecurityPolicyReportHandler

java.lang.Object
org.eclipse.scout.rt.ui.html.AbstractUiServletRequestHandler
org.eclipse.scout.rt.ui.html.csp.ContentSecurityPolicyReportHandler
All Implemented Interfaces:
IUiServletRequestHandler

public class ContentSecurityPolicyReportHandler extends AbstractUiServletRequestHandler
This handler contributes to the UiServlet as the POST handler for /csp-report

It is used to collect Content-Security-Policy violations.

If you get a violation for content you need, make sure all your content is provided from the same origin. If this is not possible you can change the rules by adjusting ContentSecurityPolicy.

Since:
5.2
  • Constructor Details

    • ContentSecurityPolicyReportHandler

      public ContentSecurityPolicyReportHandler()
  • Method Details

    • handlePost

      public boolean handlePost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
      Description copied from class: AbstractUiServletRequestHandler
      Convenience method for HTTP method POST.
      Overrides:
      handlePost in class AbstractUiServletRequestHandler
      Returns:
      true if the request was consumed by the handler, no further action is then necessary. If false is returned, other handlers may handle the request afterwards.
      Throws:
      IOException
    • getReport

      protected String getReport(jakarta.servlet.http.HttpServletRequest req) throws IOException
      Throws:
      IOException
    • log

      protected void log(String report)