Class StaticHeadersWriter

java.lang.Object
org.springframework.security.web.header.writers.StaticHeadersWriter
All Implemented Interfaces:
HeaderWriter
Direct Known Subclasses:
XContentTypeOptionsHeaderWriter

public class StaticHeadersWriter extends Object implements HeaderWriter
HeaderWriter implementation which writes the same Header instance.
Since:
3.2
  • Constructor Details

    • StaticHeadersWriter

      public StaticHeadersWriter(List<Header> headers)
      Creates a new instance
      Parameters:
      headers - the Header instances to use
    • StaticHeadersWriter

      public StaticHeadersWriter(String headerName, String... headerValues)
      Creates a new instance with a single header
      Parameters:
      headerName - the name of the header
      headerValues - the values for the header
  • Method Details

    • writeHeaders

      public void writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Description copied from interface: HeaderWriter
      Create a Header instance.
      Specified by:
      writeHeaders in interface HeaderWriter
      Parameters:
      request - the request
      response - the response
    • toString

      public String toString()
      Overrides:
      toString in class Object