Class FeaturePolicyServerHttpHeadersWriter

  • All Implemented Interfaces:
    ServerHttpHeadersWriter

    public final class FeaturePolicyServerHttpHeadersWriter
    extends java.lang.Object
    implements ServerHttpHeadersWriter
    Writes the Feature-Policy response header with configured policy directives.
    Since:
    5.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FEATURE_POLICY  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setPolicyDirectives​(java.lang.String policyDirectives)
      Set the policy directive(s) to be used in the response header.
      reactor.core.publisher.Mono<java.lang.Void> writeHttpHeaders​(org.springframework.web.server.ServerWebExchange exchange)
      Write the headers to the response.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FeaturePolicyServerHttpHeadersWriter

        public FeaturePolicyServerHttpHeadersWriter()
    • Method Detail

      • writeHttpHeaders

        public reactor.core.publisher.Mono<java.lang.Void> writeHttpHeaders​(org.springframework.web.server.ServerWebExchange exchange)
        Description copied from interface: ServerHttpHeadersWriter
        Write the headers to the response.
        Specified by:
        writeHttpHeaders in interface ServerHttpHeadersWriter
        Returns:
        A Mono which is returned to the Supplier of the ReactiveHttpOutputMessage.beforeCommit(Supplier).
      • setPolicyDirectives

        public void setPolicyDirectives​(java.lang.String policyDirectives)
        Set the policy directive(s) to be used in the response header.
        Parameters:
        policyDirectives - the policy directive(s)
        Throws:
        java.lang.IllegalArgumentException - if policyDirectives is null or empty