https://github.com/optum/kong-response-size-limiting
Block responses with bodies greater than a specified size
https://github.com/optum/kong-response-size-limiting
api-gateway kong optum
Last synced: 12 months ago
JSON representation
Block responses with bodies greater than a specified size
- Host: GitHub
- URL: https://github.com/optum/kong-response-size-limiting
- Owner: Optum
- License: apache-2.0
- Created: 2018-09-18T06:18:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-04T14:32:29.000Z (almost 5 years ago)
- Last Synced: 2025-03-11T15:51:13.356Z (about 1 year ago)
- Topics: api-gateway, kong, optum
- Language: Lua
- Size: 1.08 MB
- Stars: 0
- Watchers: 9
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Kong Response Size Limiting Plugin
## Overview
This plugin will protect the client from consuming API responses that are deemed too large within the Kong API Gateway.
1. Plugin enables Kong users to specify the size in MB that they will allow for API response sizes.
If transaction response is deemed too large the Gateway will throw an HTTP Status of 413 and a response body of "Response size limit exceeded"
## Supported Kong Releases
Kong >= 1.0
## Installation
Recommended:
```
$ luarocks install kong-response-size-limiting
```
Other:
```
$ git clone https://github.com/Optum/kong-response-size-limiting.git /path/to/kong/plugins/kong-response-size-limiting
$ cd /path/to/kong/plugins/kong-response-size-limiting
$ luarocks make *.rockspec
```
## Caveat
This plugin currently accomplishes limiting by validating the Content-Length header on API responses, if backend microservice is lacking such a standard header, then plugin will not response size limit. PRs for additional functionality welcome!
## Maintainers
[jeremyjpj0916](https://github.com/jeremyjpj0916)
[rsbrisci](https://github.com/rsbrisci)
Special thanks to [thibaultcha](https://github.com/thibaultcha) and [james-callahan](https://github.com/james-callahan) with their
suggestions!
Feel free to open issues, or refer to our [Contribution Guidelines](https://github.com/Optum/kong-response-size-limiting/blob/master/CONTRIBUTING.md) if you have any questions.