Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ilozano2/sc-management-codec-max-size
How-to implement independent `codec.max-in-memory-bytes` for Management server
https://github.com/ilozano2/sc-management-codec-max-size
Last synced: 20 days ago
JSON representation
How-to implement independent `codec.max-in-memory-bytes` for Management server
- Host: GitHub
- URL: https://github.com/ilozano2/sc-management-codec-max-size
- Owner: ilozano2
- License: apache-2.0
- Created: 2023-03-31T15:53:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-31T16:11:57.000Z (over 1 year ago)
- Last Synced: 2024-04-24T12:04:05.621Z (7 months ago)
- Language: Java
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Motivation
By default, the maximum size of any request payload a Spring boot application can read is `262144` bytes.
This value can be changed using the Spring property `spring.codec.max-in-memory-size`.
However, increasing the value of this property could expose the production controllers to some risks like a DDOS attacks.Spring Actuator endpoints or the port they listen are not usually exposed to the outside, so it could be safe increasing this value in a controlled network.
This project allows to configure a different max-in-memory-size only for the management server (aka Spring Actuator endpoints).
# Usage
The property has been named `management.codec.max-in-memory-size` and can be configured as the following example.
```yml
management:
codec:
max-in-memory-size: 1MB
```It is also possible to have different memory size in the same configuration:
```yml
# Management Server Codec configurations
management:
codec:
max-in-memory-size: 1MB# (original) Server Codec configurations
spring:
codec:
max-in-memory-size: 1KB
```