Skip to content

Extended file server capabilities#14

Merged
szeka9 merged 11 commits into
mainfrom
development
May 30, 2026
Merged

Extended file server capabilities#14
szeka9 merged 11 commits into
mainfrom
development

Conversation

@szeka9
Copy link
Copy Markdown
Owner

@szeka9 szeka9 commented May 30, 2026

  • Wildcard option for multiple URL path segments
  • Support chunked transfer encoding in responses
  • Bugfix for setting response headers repeatedly
  • Improve README, include example and API stability policy

szeka9 added 11 commits May 25, 2026 22:46
Fix misplaced modulo operator in response
header setter. This fix corrects headers
overridden with incorrect index. Add unit
tests to verify the correct behavior.

Also introduce getter method for testing and
and future usage.
Allow multiple path segments to be matched with "{segment:path}",
where ":path" indicates that multiple segments can be matched.
Such patterns are useful for using the same callback function
for resources represented by multiple path segments (e.g. files
with directory structure).
Allow examples to run directly on unix port with
"make run-unix".

Deduplicate boot.py in examples by replacing with symlinks.
Extend response handling to support chunked responses
when the transfer-encoding header is set.
Add session counter to uniquely identify HTTP sessions
for facilitating stateful application behavior.
Allow registered callback functions to return None
instead of content-type, and response body tuple.
In such case, the application is expected to set these
using the passed state machine context object.

Additionally remove the option to register file paths
as endpoints. File serving will get major improvements
in the following commits.
- Convert file server state machine extensions
to registered endpoints. When enabled, callback
functions are registered under the /files endpoint.

- Basic file retrieval feature is included by default
in the main http module, restricting read access to /www.

- Add the following features in the revised
file server module:
  - retrieve directory structure in json format when
    the request refers to a directory
  - support single/bulk file uploads under a predefined
    directory, with chunked and partial upload handling
  - allow uploaded files to be deleted

- Move path normalization helper to utils.helpers, and
restructure related unit tests.
- reorganize test modules, split large test units
- override HTTP configuration explicitely in each unit test;
avoid relying on defaults
- create an additional test for multipart chunked file uploads
to verify that file chunks are correctly consumed per file
regardless of ordering
- fix linting issues
- fix file path validation to enforce absolute paths
- reject "." and ".." used as absolute path segments,
always expect normalized paths
- add unit tests covering the aforementioned requirements
- 'http_serve_files' is ambiguous; rename it to 'http_files_api' to
indicate that it only applies to the optional file serving API

- set the default of http_file_api to false, as basic file serving
is enabled by default as a state machine extension (_fs_retrieve_st)

- add API documentation about /files
Improve the phrasing and structure,
include a simple application as
an example.

Add clear API stability policy
and project status section.
@szeka9 szeka9 merged commit df7dbb5 into main May 30, 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