Class CorsDirectives

  • Direct Known Subclasses:
    TlsDirectives

    public abstract class CorsDirectives
    extends FramedEntityStreamingDirectives
    Directives for CORS, cross origin requests.

    For an overview on how CORS works, see the MDN web docs page on CORS: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS CORS is part of the WHATWG Fetch "Living Standard" https://fetch.spec.whatwg.org/#http-cors-protocol

    This implementation is based on the akka-http-cors project by Lomig Mégard, licensed under the Apache License, Version 2.0.

    • Constructor Detail

      • CorsDirectives

        public CorsDirectives()
    • Method Detail

      • cors

        public Route cors​(java.util.function.Supplier<Route> inner)
        Wraps its inner route with support for the CORS mechanism, enabling cross origin requests.

        The settings are loaded from the Actor System configuration.

        Parameters:
        inner - (undocumented)
        Returns:
        (undocumented)
      • cors

        public Route cors​(CorsSettings settings,
                          java.util.function.Supplier<Route> inner)
        Wraps its inner route with support for the CORS mechanism, enabling cross origin requests using the given cors settings.
        Parameters:
        settings - (undocumented)
        inner - (undocumented)
        Returns:
        (undocumented)