Skip to content

Releases: szeka9/PyRobusta

v0.7.0

11 Jun 21:32
8cce0f1

Choose a tag to compare

What's Changed

This release introduces streamed HTTP responses, an optional file server API, enhanced wildcard route matching, stricter RFC compliance checks, and improved load-testing methodology.

File Server Module

Support CRUD operations for files stored on the server, including access to nested directory paths. Add new API endpoint (/files) that can be optionally enabled in the config.

Chunked response encoding

Support chunked response encoding via Transfer-Encoding: chunked. When enabled, each yielded output from the response callback is transmitted as an individual chunk, allowing streamed responses without a predefined content length.

Wildcard URL path segments

Wildcard route parameters can now match multiple path segments using the {name:path} syntax (e.g. /path/to/{resource:path}), enabling routes that operate on arbitrary file and directory paths.

Routing API Changes

Route registration now accepts callback handlers only. Static file paths can no longer be registered as routes. Basic file serving is available independently of route configuration. This change is non-backwards compatible.

RFC compliance

  • reject GET requests containing a message body with HTTP 400 to enforce stricter RFC compliance; this might be non-backwards compatible depending on the application
  • validate request payload size against Content-Length and reject malformed requests where the declared and received body lengths differ
  • multipart responses now use chunked transfer encoding because the final response size cannot be determined before serialization; this might be non-backwards compatible depending on the client

Improved Load Testing

  • use the Locust framework for simulating network traffic with predefined user classes
  • heap usage is now measured after garbage collection to show real memory retention
  • display response time statistics (measured by Locust) on the heap usage graphs
  • use dedicated user classes for different configurations, simulate streamed and multipart request and response payloads

Pull Requests

  • Extended file server capabilities by @szeka9 in #14
  • Enforce strict content-length validation; update documentation by @szeka9 in #15
  • Improvements for content-length handling and chunked encoding by @szeka9 in #16
  • Load testing improvements; use Locust framework by @szeka9 in #17
  • Bump MicroPython version to v1.28.0 by @szeka9 in #18
  • Bump version to v0.7.0 by @szeka9 in #19

Full Changelog: v0.6.0...v0.7.0

v0.6.0

06 May 17:23
1f51083

Choose a tag to compare

What's Changed

Wildcard URL Routing

Added support for wildcard URL paths with placeholder segments,
enabling more flexible routing patterns and reduced code duplication.
Example application updated to demonstrate common routing scenarios.

HTTP Header Handling Improvements

Support for combined header field values; multiple headers with the same
name are merged into a comma-separated list. This aligns behavior with RFC 9110.

Keep-Alive Connection Support

Implemented persistent connections for HTTP/1.0 and HTTP/1.1.
Connections are now reused based on correct protocol framing and HTTP version.
Safeguards are introduced for invalid or unsafe reuse scenarios with proper
boundary detection in pipelined requests.

HTTP Parser Refactor

  • State machine execution is now centralized via HttpEngine.run()
  • Removed response-specific helper methods, HttpEngine.terminate(status_code) and HttpEngine.abort(status_code) methods are introduced for simplifying the public API [backwards-incompatible]
    • abort(status_code) is introduced for unsafe parser states to prevent connection reuse when protocol framing is compromised
  • State machine termination no longer requires buffer arguments to enable application code to set arbitrary status codes via HttpEngine.terminate(status_code)

Bug Fixes

Empty Request Handling

Fixed exception caused by invalid parser state comparison on empty input. The fix eliminates the exception and warning message when a keep-alive connection is closed.

Pull Requests

  • Keep-alive connection handling, refactor state machine parser by @szeka9 in #10
  • Combined header field values, optimize header management by @szeka9 in #11
  • Wildcard URL support, fix for response generation on empty requests by @szeka9 in #12
  • v0.6.0 release and dimensioning measurements by @szeka9 in #13

Full Changelog: v0.5.0...v0.6.0

v0.5.0

12 Apr 11:01
f8cb56f

Choose a tag to compare

What's Changed

  • Improved configuration handling, increased test coverage by @szeka9 in #5
  • Connection handling improvements, measurements for dimensioning by @szeka9 in #6
  • Update documentation, bump version to v0.5.0 by @szeka9 in #7
  • Update README and documentation by @szeka9 in #8
  • Cross-compile outdated modules for the mip package by @szeka9 in #9

v0.5.0 delivers improved connection handling, config normalization with type conversion as well as improved test coverage.
The webserver now defaults to port 80 and 443 for user convenience with the option to override from configuration.

Full Changelog: v0.4.0...v0.5.0

v0.4.0

04 Apr 00:04
d99d778

Choose a tag to compare

What's Changed

Full Changelog: v0.3.0...v0.4.0

v0.4.0 delivers parser hardening, better file-serving support, multipart response improvements, and server refactoring, plus a new default web page with documentation. There are a few backward-incompatible changes:

  • callback functions are expected to return content-type per part for multipart response generation
  • default server ports changed to 80/443
  • on_busy() renamed to on_unavailable() for state machine termination with 503 status code
  • run_server() renamed to start_socket_server() in http_server module

v0.3.0

31 Mar 21:04
7bc049c

Choose a tag to compare

What's Changed

  • Chunked transfer decoding and improved FS access control with path normalization by @szeka9 in #3

Full Changelog: v0.2.0...v0.3.0

Streaming support with chunked transfer decoding

Added support for decoding chunked transfer encoding, enabling handling of streaming payloads where the total size is not known in advance.

Improved path normalization

Enhanced lexical path normalization to better support virtual and device root paths. The current working directory is now used as the virtual root for more consistent behavior.

v0.2.0

27 Mar 19:29
ed30b9b

Choose a tag to compare

  • update callback function signature to accept HTTP context object for future extensibility
  • eliminate usages of dictionaries from the parser class, use simpler lookups instead
  • allow url-encoded query with percent encoding
  • fix HEAD method for static resources