Class XFrameHandler

java.lang.Object
io.vertx.mutiny.ext.web.handler.XFrameHandler
All Implemented Interfaces:
MutinyDelegate, io.vertx.core.Handler<RoutingContext>, SecurityPolicyHandler, Consumer<RoutingContext>

public class XFrameHandler extends Object implements SecurityPolicyHandler, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>, MutinyDelegate
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. Sites can use this to avoid click-jacking attacks, by ensuring that their content is not embedded into other sites. The added security is provided only if the user accessing the document is using a browser that supports X-Frame-Options.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Paulo Lopes
See Also:
  • XFrameHandler
  • Field Details

    • DENY

      public static final String DENY
      The page cannot be displayed in a frame, regardless of the site attempting to do so.
      See Also:
    • SAMEORIGIN

      public static final String SAMEORIGIN
      The page can only be displayed in a frame on the same origin as the page itself. The spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin.
      See Also:
    • __TYPE_ARG

      public static final TypeArg<XFrameHandler> __TYPE_ARG
  • Constructor Details

    • XFrameHandler

      public XFrameHandler(io.vertx.ext.web.handler.XFrameHandler delegate)
      Create a new instance of XFrameHandler delegating to the given (non-null) instance of XFrameHandler.
    • XFrameHandler

      public XFrameHandler(Object delegate)
  • Method Details

    • accept

      public void accept(RoutingContext item)
      Handle an item. This method is generated from the original method."
      Specified by:
      accept in interface Consumer<RoutingContext>
      Specified by:
      accept in interface SecurityPolicyHandler
    • handle

      public void handle(RoutingContext item)
      Handle an item. This method is generated from the original method."
      Specified by:
      handle in interface io.vertx.core.Handler<RoutingContext>
      Specified by:
      handle in interface SecurityPolicyHandler
    • getDelegate

      public io.vertx.ext.web.handler.XFrameHandler getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface SecurityPolicyHandler
      Returns:
      the delegate instance
    • create

      public static XFrameHandler create(String action)
      Creates a new handler that will add the X-FRAME-OPTIONS header to the current response.
      Parameters:
      action - a string value either DENY or SAMEORIGIN.
      Returns:
      the handler
    • newInstance

      public static XFrameHandler newInstance(io.vertx.ext.web.handler.XFrameHandler delegate)
      Creates a new instance of the XFrameHandler.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object