Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
/ krakend-sizelimit Public archive

KrakenD middleware to limit the size of incoming requests

License

Notifications You must be signed in to change notification settings

kivra/krakend-sizelimit

Repository files navigation

krakend-sizelimit

The sizelimit middleware can be used to limit the request size of incoming requests.

Installation

To install sizelimit from GitHub:

go get -u github.com/kivra/krakend-sizelimit@<commit hash>

Then add sizelimit to the KrakenD handler_factory chain:

handlerFactory = sizelimit.HandlerFactory(handlerFactory)

Usage

Add sizelimit to the endpoint's extra_config and define the maximum request body size. If no unit is specified, max_size is assumed to have unit bytes. Other units can be specified explictly: B (bytes, same as no unit), kB, MB, GB, TB.

"endpoints": [
  {
    "endpoint": "/test",
    "extra_config": {
      "kivra/sizelimit": {
        "max_size": "10MB"
      }
    },
    "backend": [ "..." ]
  }
]

About

KrakenD middleware to limit the size of incoming requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published