Class CARequestLimits
java.lang.Object
com.io7m.cardant.server.service.reqlimit.CARequestLimits
- All Implemented Interfaces:
com.io7m.repetoir.core.RPServiceType
Methods to handle request size limits.
-
Constructor Summary
ConstructorsConstructorDescriptionCARequestLimits(CAConfigurationServiceType inConfigService, Function<Long, String> inRequestTooLargeMessage) Methods to handle request size limits. -
Method Summary
Modifier and TypeMethodDescriptionboundedMaximumInput(io.helidon.webserver.http.ServerRequest request, long maximum) Bound the given servlet request to the given maximum size, raising an exception if the incoming Content-Length is larger than this size.boundedMaximumInputForFileUpload(io.helidon.webserver.http.ServerRequest request) Bound the given servlet request to a maximum size suitable for file uploads, raising an exception if the incoming Content-Length is larger than this size.boundedMaximumInputForLoginCommand(io.helidon.webserver.http.ServerRequest request) Bound the given servlet request to a maximum size suitable for login commands, raising an exception if the incoming Content-Length is larger than this size.toString()
-
Constructor Details
-
CARequestLimits
public CARequestLimits(CAConfigurationServiceType inConfigService, Function<Long, String> inRequestTooLargeMessage) Methods to handle request size limits.- Parameters:
inConfigService- The configuration serviceinRequestTooLargeMessage- A function that formats a message
-
-
Method Details
-
boundedMaximumInput
public InputStream boundedMaximumInput(io.helidon.webserver.http.ServerRequest request, long maximum) throws CARequestLimitExceeded Bound the given servlet request to the given maximum size, raising an exception if the incoming Content-Length is larger than this size.- Parameters:
request- The requestmaximum- The maximum size- Returns:
- A bounded input stream
- Throws:
CARequestLimitExceeded- On errors
-
description
- Specified by:
descriptionin interfacecom.io7m.repetoir.core.RPServiceType
-
toString
-
boundedMaximumInputForFileUpload
public InputStream boundedMaximumInputForFileUpload(io.helidon.webserver.http.ServerRequest request) throws CARequestLimitExceeded Bound the given servlet request to a maximum size suitable for file uploads, raising an exception if the incoming Content-Length is larger than this size.- Parameters:
request- The request- Returns:
- A bounded input stream
- Throws:
CARequestLimitExceeded- On errors
-
boundedMaximumInputForLoginCommand
public InputStream boundedMaximumInputForLoginCommand(io.helidon.webserver.http.ServerRequest request) throws CARequestLimitExceeded Bound the given servlet request to a maximum size suitable for login commands, raising an exception if the incoming Content-Length is larger than this size.- Parameters:
request- The request- Returns:
- A bounded input stream
- Throws:
CARequestLimitExceeded- On errors
-