Package io.muserver.handlers
Class HttpsRedirector
- java.lang.Object
-
- io.muserver.handlers.HttpsRedirector
-
- All Implemented Interfaces:
MuHandler
public class HttpsRedirector extends java.lang.Object implements MuHandler
Sends any HTTP requests to the same HTTPS address at the supplied port and optionally enables Strict-Transport-Security (HSTS)
- See Also:
HttpsRedirectorBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpsRedirector.Builder
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
handle(MuRequest request, MuResponse response)
Called when an HTTP request is made (unless a previous handler stopped handler processing)static HttpsRedirectorBuilder
toHttpsPort(int port)
Deprecated.java.lang.String
toString()
-
-
-
Method Detail
-
handle
public boolean handle(MuRequest request, MuResponse response) throws java.lang.Exception
Description copied from interface:MuHandler
Called when an HTTP request is made (unless a previous handler stopped handler processing)- Specified by:
handle
in interfaceMuHandler
- Parameters:
request
- The HTTP request.response
- The HTTP response.- Returns:
- Return
false
to continue processing the next handler (for example if writing a filter or inspector); ortrue
to stop processing (normally done if this handler sent a response). - Throws:
java.lang.Exception
- Any uncaught exceptions will result in a 500 error code being returned to the client with a simple message.
-
toHttpsPort
@Deprecated public static HttpsRedirectorBuilder toHttpsPort(int port)
Deprecated.- Parameters:
port
- The port to redirect to- Returns:
- A builder
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-