Skip to content

Chunked transfer decoding and improved FS access control with path normalization#3

Merged
szeka9 merged 8 commits into
mainfrom
development
Mar 31, 2026
Merged

Chunked transfer decoding and improved FS access control with path normalization#3
szeka9 merged 8 commits into
mainfrom
development

Conversation

@szeka9
Copy link
Copy Markdown
Owner

@szeka9 szeka9 commented Mar 31, 2026

New features:

  • add chunked transfer decoding to support streaming payloads with unknown size
  • improve lexical path normalization to handle virtual and device root paths; use the current working directory as the virtual root

Miscellaneous improvements:

  • optimize memory usage by 1-2% by shortening string literals
  • unify directory structure between manual deployments and mip installations
  • update default configuration to serve /lib/pyrobusta in the mip repository example

szeka9 added 8 commits March 28, 2026 14:10
- support "Transfer-Encoding: chunked" in requests
- rename _recv_payload to _recv_payload_st to remain consistent
in naming internal states
- remove unnecessary branch in response generation for image/jpeg content type
- add new unit tests and functional test
- always use /lib for deployment to
match the default mip installation path
- refine lexical path normalization to account for differences
  in default working directories between Unix and device runtimes;
  always treat the default working directory as a virtual root

- return HTTP 403 (Forbidden) when accessing files outside
  configured directories served over HTTP

- add unit and functional tests for access control and path normalization
- use __name__ for module-prefixed log messages
- reduce log message lengths
- lazy-load ssl library based on TLS setting
Create missing root directory
for mip packages.
Optimize memory usage and replace ambiguous variable
names (e.g. "mp_is_first" instead of "mp_first_part").
str.splitlines() may be unavailable in ESP8266 builds,
(depending on MICROPY_PY_BUILTINS_STR_SPLITLINES).
Replace its usage with manual line iteration and
rstrip() to handle line endings.
@szeka9 szeka9 merged commit 7bc049c into main Mar 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant