1
0
mirror of https://github.com/H0llyW00dzZ/My-RESTAPIs-Boilerplate.git synced 2025-02-06 09:44:31 +00:00

Docs [Environment variable] Update Comments for "SIZE_BODY_LIMIT" (#1500)

- [+] docs(env.go): update comments for SIZEBODYLIMIT to include security considerations and best practices for request body size
This commit is contained in:
H0llyW00dzZ 2025-01-07 07:48:12 +07:00 committed by GitHub
parent b966b66680
commit 185ccc8e62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

8
env/env.go vendored
View File

@ -38,7 +38,13 @@ const (
// App/Server Capacity Configuration
const (
SIZEBODYLIMIT = "SIZE_BODY_LIMIT" // The maximum size limit for the request body (default: "4MiB" (equivalent to 4 * 1024 * 1024 bytes)).
// The maximum size limit for the request body (default: "4MiB", equivalent to 4 * 1024 * 1024 bytes).
//
// Note: For security reasons, you should be careful when setting the size of the request body. For example, if you set it to more than 4MiB (e.g., 100MiB),
// it can lead to resource exhaustion due to excessive memory consumption, which may cause a crash with an OOM (Out Of Memory) error on Kubernetes,
// especially when using the "immutable" tag. Therefore, if you need to handle large request bodies, such as for file uploads,
// you should use the Stream method to process the data in smaller chunks.
SIZEBODYLIMIT = "SIZE_BODY_LIMIT"
)
// MySQL Database Configuration