handy-http-web-filters 1.0.1

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).
Authors:
  • Andrew Lalis
Dependencies:
slf4d, handy-http-handlers, handy-http-primitives
Versions:
1.0.1 2026-Aug-29
1.0.0 2026-Aug-29
~main 2026-Aug-29
Show all 3 versions
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