diff options
| author | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-21 23:34:13 -0600 |
|---|---|---|
| committer | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-21 23:34:13 -0600 |
| commit | e53ce0d54dcf6cbf5caf7cc4b91fe993e6bfddc4 (patch) | |
| tree | f02a4a436fbf70dc643fdd1026bac3218f9e4044 /runtime/src/main.cpp | |
| parent | 067d3e8b97189fcf272dc699fdbb871eae496660 (diff) | |
viewer: test the serve.py guards, and make a bad --port a usage error
viewer/serve.py holds the DNS-rebinding Host check, the /world/ traversal
resolver and the 403s in front of them, and nothing tested it: the CI viewer
job runs only the streaming tests. tests/test_viewer_serve.py covers the Host
allow/deny matrix, path resolution (.., encoded %2e%2e, backslashes, NUL,
drive letters, reserved device names, directories, a symlink out of the
world) and the HTTP layer on a loopback server (200 with no-store, the .glb
MIME type, HEAD, query strings, 403 for a foreign Host and for traversal).
--port was a plain int, so 70000 or -1 reached socketserver and ended in
OverflowError; 0 bound a free port but printed the URL of port 0. It is now
an argparse type limited to 0-65535, and the message prints the bound port.
Negative control on main: the CLI test fails (exit 1 with a traceback) and
port_number does not exist. With the change: 21/21. The node viewer tests
still pass 29/29. Standard library only, temporary world folder, no game data.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Diffstat (limited to 'runtime/src/main.cpp')
0 files changed, 0 insertions, 0 deletions