Lukas Kremla 482ab6d5ca Fixed gzip automatic content-type assignment and added automatic compression header configuration (#251)
* Fixed gzip automatic content-type assignment and added automatic compression setting

This implements the fix for detecting the proper content-type even when the file has the ".gz" extension. It further makes sure the compression headers are set properly if a "gz." file is detected, but the compression headers weren't explicitly set by the user.

* Added a test for properly auto-determining mime types and setting content encoding header

* Modified the gzip file header assignments and following tests according to the feedback.

---------

Co-authored-by: Lukáš Kremla <lukas.kremla@bonnel.cz>
2024-08-14 23:02:23 +01:00
2024-01-31 23:43:17 +00:00
2024-01-31 23:43:17 +00:00
2023-03-03 11:06:50 +00:00
2023-06-20 12:34:59 +01:00
2024-06-18 23:14:14 +01:00
2019-04-16 12:00:41 +01:00
2024-06-18 23:14:36 +01:00
2024-03-10 17:15:14 +00:00
2024-01-31 23:43:17 +00:00
2021-09-27 13:57:04 +01:00
2023-12-28 12:59:19 +00:00

microdot

Build status codecov

“The impossibly small web framework for Python and MicroPython”

Microdot is a minimalistic Python web framework inspired by Flask. Given its small size, it can run on systems with limited resources such as microcontrollers. Both standard Python (CPython) and MicroPython are supported.

from microdot import Microdot

app = Microdot()

@app.route('/')
async def index(request):
    return 'Hello, world!'

app.run()

Migrating to Microdot 2

Version 2 of Microdot incorporates feedback received from users of earlier releases, and attempts to improve and correct some design decisions that have proven to be problematic.

For this reason most applications built for earlier versions will need to be updated to work correctly with Microdot 2. The Migration Guide describes the backwards incompatible changes that were made.

Resources

Roadmap

The following features are planned for future releases of Microdot, both for MicroPython and CPython:

  • Support for forms encoded in multipart/form-data format
  • Authentication support, similar to Flask-Login for Flask
  • OpenAPI integration, similar to APIFairy for Flask

In addition to the above, the following extensions are also under consideration, but only for CPython:

Do you have other ideas to propose? Let's discuss them!

Description
The impossibly small web framework for Python and MicroPython.
Readme 2.9 MiB
Languages
Python 99.2%
Shell 0.6%
Dockerfile 0.2%