3x-ui/internal/web
n0ctal 71616b7cf2
feat(web): cap request body size on state-changing routes (#5271)
* feat(web): cap request body size on state-changing routes

* fix(web): exempt importDB from request body size cap

The 10 MiB body cap was applied globally, which would break database
restore (/panel/api/server/importDB) on any panel whose SQLite backup
exceeds the limit. Make MaxBodyBytes accept exempt path suffixes and
pass importDB through uncapped; the cap still covers all other
state-changing routes. Add a test for the skip-suffix behavior.

---------

Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2026-06-15 16:04:16 +02:00
..
controller feat(node): per node outbound routing (#5275) 2026-06-14 23:10:52 +02:00
entity feat: replace panel proxy URL with outbound-based egress bridge 2026-06-10 23:52:20 +02:00
global refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
job feat(mtproto): route Telegram egress through Xray routing rules 2026-06-12 17:58:45 +02:00
locale refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
middleware feat(web): cap request body size on state-changing routes (#5271) 2026-06-15 16:04:16 +02:00
network refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
runtime Test-quality audit: fix 2 prod bugs, strengthen weak tests, add mutation/fuzz/CI tooling (#5345) 2026-06-15 15:17:03 +02:00
service fix(nodes): sync "start after first connect" expiry so un-activated nodes do not reset it (#5319) 2026-06-15 15:46:19 +02:00
session refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
translation feat(node): per node outbound routing (#5275) 2026-06-14 23:10:52 +02:00
websocket refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
cadence_test.go refactor(web): centralize background job cadences (#5269) 2026-06-14 22:50:24 +02:00
web.go feat(web): cap request body size on state-changing routes (#5271) 2026-06-15 16:04:16 +02:00