mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
test: match the new upload url shape; keep the config cap under the WS frame limit
test_upload_ok still asserted the old '<name>?v=<mtime>' url — uploads take a free name now, so the name itself is the cache key and the query is gone. MAX_CONFIG_BYTES was 12 MB, above the WebSocket frame limit: a payload that big never reaches the handler, the socket just closes with 1009 and the user sees a dropped connection instead of an actionable error. 4 MB is far above any real configuration and comfortably inside the frame. test_upload_never_overwrites listed the whole shared test config folder.
This commit is contained in:
@@ -81,7 +81,10 @@ MAX_KNOWN_DEVICES = 20000
|
||||
MAX_TEXT = 500 # names, models, ids
|
||||
MAX_DESCRIPTION = 4000
|
||||
MAX_URL = 2000
|
||||
MAX_CONFIG_BYTES = 12 * 1024 * 1024
|
||||
# Below the WebSocket frame limit on purpose: a payload larger than that never
|
||||
# reaches the handler at all — the socket closes with 1009 and the user sees a
|
||||
# dropped connection instead of an error they can act on.
|
||||
MAX_CONFIG_BYTES = 4 * 1024 * 1024
|
||||
|
||||
_TEXT = vol.All(str, vol.Length(max=MAX_TEXT))
|
||||
_TEXT_OR_NONE = vol.Any(None, _TEXT)
|
||||
|
||||
Reference in New Issue
Block a user