org.springframework.web.server.adapter

Class ForwardedHeaderTransformer

  • java.lang.Object
    • org.springframework.web.server.adapter.ForwardedHeaderTransformer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      ServerHttpRequest apply(ServerHttpRequest request)
      Apply and remove, or remove Forwarded type headers.
      protected boolean hasForwardedHeaders(ServerHttpRequest request)
      Whether the request has any Forwarded headers.
      boolean isRemoveOnly()
      Whether the "remove only" mode is on.
      void setRemoveOnly(boolean removeOnly)
      Enable mode in which any "Forwarded" or "X-Forwarded-*" headers are removed only and the information in them ignored.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, compose, identity
    • Constructor Detail

      • ForwardedHeaderTransformer

        public ForwardedHeaderTransformer()
    • Method Detail

      • setRemoveOnly

        public void setRemoveOnly(boolean removeOnly)
        Enable mode in which any "Forwarded" or "X-Forwarded-*" headers are removed only and the information in them ignored.
        Parameters:
        removeOnly - whether to discard and ignore forwarded headers
      • isRemoveOnly

        public boolean isRemoveOnly()
        Whether the "remove only" mode is on.
        See Also:
        setRemoveOnly(boolean)
      • hasForwardedHeaders

        protected boolean hasForwardedHeaders(ServerHttpRequest request)
        Whether the request has any Forwarded headers.
        Parameters:
        request - the request