Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gravitee-io/gravitee-policy-request-content-limit
Gravitee Policy - Request content size limit
https://github.com/gravitee-io/gravitee-policy-request-content-limit
Last synced: about 1 month ago
JSON representation
Gravitee Policy - Request content size limit
- Host: GitHub
- URL: https://github.com/gravitee-io/gravitee-policy-request-content-limit
- Owner: gravitee-io
- License: apache-2.0
- Created: 2015-12-21T14:28:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-17T06:10:52.000Z (over 1 year ago)
- Last Synced: 2023-09-17T11:06:55.937Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 71.3 KB
- Stars: 0
- Watchers: 27
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.adoc
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.adoc
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
= Request content limit policy
ifdef::env-github[]
image:https://img.shields.io/static/v1?label=Available%20at&message=Gravitee.io&color=1EC9D2["Gravitee.io", link="https://download.gravitee.io/#graviteeio-apim/plugins/policies/gravitee-policy-request-content-limit/"]
image:https://img.shields.io/badge/License-Apache%202.0-blue.svg["License", link="https://github.com/gravitee-io/gravitee-policy-request-content-limit/blob/master/LICENSE.txt"]
image:https://img.shields.io/badge/semantic--release-conventional%20commits-e10079?logo=semantic-release["Releases", link="https://github.com/gravitee-io/gravitee-policy-request-content-limit/releases"]
image:https://circleci.com/gh/gravitee-io/gravitee-policy-request-content-limit.svg?style=svg["CircleCI", link="https://circleci.com/gh/gravitee-io/gravitee-policy-request-content-limit"]
endif::[]== Phase
|===
|onRequest |onResponse
|X|
|===== Description
You can use the `request-content-limit` policy to specify a maximum request content length allowed.
This limit is compared to the content length header of the request.== Compatibility with APIM
|===
| Plugin version | APIM version
| 1.x | All supported versions
|===== Configuration
You can configure the policy with the following options:
|===
|Property |Required |Description |Type|limit
|true
|Maximum length of request content allowed
|int|===
[source, json]
.Sample
----
"request-content-limit": {
"limit": 1000
}
----== Errors
=== Default errors
|===
|Code |Message.^| ```400```
| The limit from the configuration is not correct..^| ```413```
| Incoming HTTP request payload exceed the size limit..^| ```411```
| The HTTP request is not chunked and does not specify the `Content-Length` header.|===
=== Default response override
You can use the response template feature to override the default responses provided by the policy. These templates must be defined at the API level (see the API Console *Response Templates*
option in the API *Proxy* menu).Some possible responses are:
|===
|Error |description
|400|Content-length is not a valid integer.
|411|The request did not specify the length of its content, which is required by the requested resource.
|413|The request is larger than the server is willing or able to process.
|====== Error keys
The error keys sent by this policy are as follows:
[cols="2*", options="header"]
|===
^|Key
^|Parameters.^|REQUEST_CONTENT_LIMIT_TOO_LARGE
^.^|length - limit.^|REQUEST_CONTENT_LIMIT_LENGTH_REQUIRED
^.^|limit|===