internal: centralize size/length constants; better DoS protection
...also adds a bounded custom event registry for cardinality control but I ran out of space in the commit message. Praise be to the long descriptions... Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic205f69804c7fb24c39fa84abdd9546b6a6a6964
This commit is contained in:
parent
371c5f3506
commit
c3b77696aa
3 changed files with 118 additions and 0 deletions
9
internal/limits/constants.go
Normal file
9
internal/limits/constants.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package limits
|
||||
|
||||
// Size limits for request processing
|
||||
const (
|
||||
MaxEventSize = 4 * 1024 // 4KB max event payload
|
||||
MaxPathLen = 2048 // max path length
|
||||
MaxRefLen = 2048 // max referrer length
|
||||
MaxWidth = 10000 // max reasonable screen width
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue