Files
meshview/meshview
5214b233c1 Keep /api/lang and the static page route inside their directories (#173)
* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Keep /api/lang and the static page route inside their directories

Two routes built a filename from request input without checking where it
ended up:

- /api/lang?lang=... joined the value onto the lang directory and added
  ".json". os.path.join discards the directory when the value is an
  absolute path, so ?lang=/some/where/file returned /some/where/file.json.
  Any .json file the server process can read was served.
- /{page} appended ".html" and read static/<page>. aiohttp passes an
  encoded slash (%2F) through a single path segment and unquotes it, so
  /..%2F..%2F..%2Fx read ../../../x.html relative to the static directory.

The lang route now only accepts a plain language code (en, es, pt-BR, ...)
and falls back to English otherwise, exactly as it already did for unknown
languages. The page route resolves the final path and requires it to be a
file inside meshview/static, the same check /docs/{doc} already does.

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Pablo Revilla <pablorevilla@gmail.com>
Co-authored-by: Nathan <nathan@stonekitty.net>
Co-authored-by: Claude Mythos 5.1 <noreply@anthropic.com>
2026-10-14 07:22:37 -07:00
..
2026-02-10 11:07:22 -08:00
2026-02-10 12:23:17 -08:00
2026-09-09 16:33:46 -07:00
2024-07-29 21:43:15 -07:00
2026-02-09 21:29:53 -08:00
2024-05-17 21:55:54 -07:00
2026-05-25 09:07:59 -07:00
2026-09-10 15:39:55 -07:00