Class HttpsOnlyService

  • All Implemented Interfaces:
    com.linecorp.armeria.server.Service<com.linecorp.armeria.common.HttpRequest,​com.linecorp.armeria.common.HttpResponse>

    public class HttpsOnlyService
    extends com.linecorp.armeria.server.SimpleDecoratingService<com.linecorp.armeria.common.HttpRequest,​com.linecorp.armeria.common.HttpResponse>
    A SimpleDecoratingService which redirects HTTP requests from a proxy to HTTPS. Meant for use in an externally-facing, production frontend server (restricted servers should use an authenticating proxy like Identity-Aware Proxy, which handles redirects itself).

    Insecure HTTP requests are redirected to HTTPS while HTTPS responses have best practice secure headers such as Strict-Transport-Security and embed blocking.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.linecorp.armeria.common.HttpResponse serve​(com.linecorp.armeria.server.ServiceRequestContext ctx, com.linecorp.armeria.common.HttpRequest req)  
      • Methods inherited from class com.linecorp.armeria.server.DecoratingService

        as, delegate, serviceAdded, shouldCachePath, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.linecorp.armeria.server.Service

        decorate, decorate, decorate
    • Method Detail

      • serve

        public com.linecorp.armeria.common.HttpResponse serve​(com.linecorp.armeria.server.ServiceRequestContext ctx,
                                                              com.linecorp.armeria.common.HttpRequest req)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception