handy-http-web-filters 1.0.0
Common web server middleware filters to use when building a server with Handy-Http.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
web-filters
Common web server middleware filters to use when building a server with Handy-Http.
Usage
Use the FilterChainBuilder struct as a fluent interface for building a filter
chain to apply to all incoming requests to a handler.
import handy_http_starter;
import handy_http_web_filters;
auto rootHandler = getMyHttpHandler();
auto filteredHandler = FilterChainBuilder()
.withExceptionHandling()
.maxContentLength(1024*1024*20)
.cors((ref customizer) {
customizer.allowOrigin("http://localhost:8080");
customizer.maxAge(1000);
customizer.allowCredentials(true);
})
.rateLimit(50, 3)
.add(new MyCustomFilter())
.build(rootHandler);
startServer(rootHandler);
In the above example, all requests will now pass through the following filters
before hitting the rootHandler:
- An exception handling filter that gracefully logs errors.
- A content-length filter that enforces a maximum request size.
- A CORS filter that adds various CORS headers to the response.
- A token-bucket rate limiter.
- Some custom filter (you can add any other filter like this).
- 1.0.0 released 3 days ago
- handy-http/handy-http-web-filters
- CC0
- Copyright © 2026, Andrew Lalis
- Authors:
- Dependencies:
- slf4d, handy-http-handlers, handy-http-primitives
- Versions:
-
Show all 3 versions1.0.1 2026-Aug-29 1.0.0 2026-Aug-29 ~main 2026-Aug-29 - Download Stats:
-
-
0 downloads today
-
2 downloads this week
-
2 downloads this month
-
2 downloads total
-
- Score:
- 0.0
- Short URL:
- handy-http-web-filters.dub.pm