microdot 2.6.1__tar.gz → 2.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {microdot-2.6.1/src/microdot.egg-info → microdot-2.6.2}/PKG-INFO +1 -1
- {microdot-2.6.1 → microdot-2.6.2}/pyproject.toml +1 -1
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/__init__.py +1 -1
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/microdot.py +2 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/multipart.py +2 -1
- {microdot-2.6.1 → microdot-2.6.2/src/microdot.egg-info}/PKG-INFO +1 -1
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot.egg-info/SOURCES.txt +0 -1
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot.egg-info/dependency_links.txt +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot.egg-info/not-zip-safe +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot.egg-info/requires.txt +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot.egg-info/top_level.txt +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_multipart.py +14 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_response.py +2 -0
- microdot-2.6.1/docs/implementation/type_hints.rst +0 -16
- {microdot-2.6.1 → microdot-2.6.2}/LICENSE +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/MANIFEST.in +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/README.md +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/Makefile +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/_static/css/custom.css +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/asgi.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/auth.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/cors.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/csrf.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/index.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/jinja.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/login.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/microdot.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/multipart.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/sessions.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/sse.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/test_client.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/utemplate.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/websocket.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/api/wsgi.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/conf.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/auth.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/cors.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/csrf.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/index.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/login.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/multipart.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/production.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/sessions.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/sse.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/templates.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/test_client.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/extensions/websocket.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/implementation/freezing.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/implementation/index.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/implementation/migrating.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/index.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/intro.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/make.bat +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/users-guide/concurrency.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/users-guide/defining-routes.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/users-guide/index.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/users-guide/intro.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/users-guide/request-object.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/docs/users-guide/responses.rst +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/setup.cfg +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/__init__.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/asgi.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/asgi.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/auth.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/auth.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/cors.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/cors.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/csrf.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/csrf.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/helpers.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/helpers.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/jinja.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/jinja.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/login.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/login.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/microdot.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/multipart.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/py.typed +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/session.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/session.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/sse.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/sse.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/test_client.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/test_client.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/utemplate.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/utemplate.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/websocket.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/websocket.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/wsgi.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/src/microdot/wsgi.pyi +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/__init__.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.bin +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.css +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.gif +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.gz +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.html +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.jpg +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.js +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.json +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.png +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.txt +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/files/test.txt.gz +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/mock_socket.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/templates/hello.jinja.txt +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/templates/hello.utemplate.txt +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/templates/hello_utemplate_txt.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_asgi.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_auth.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_cors.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_csrf.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_end2end.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_jinja.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_login.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_microdot.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_multidict.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_request.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_session.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_sse.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_url_pattern.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_urlencode.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_utemplate.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_websocket.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tests/test_wsgi.py +0 -0
- {microdot-2.6.1 → microdot-2.6.2}/tox.ini +0 -0
|
@@ -611,6 +611,8 @@ class Response:
|
|
|
611
611
|
:param http_only: The cookie's ``HttpOnly`` flag.
|
|
612
612
|
:param partitioned: Whether the cookie is partitioned.
|
|
613
613
|
"""
|
|
614
|
+
if ';' in value:
|
|
615
|
+
raise ValueError('invalid cookie value')
|
|
614
616
|
http_cookie = '{cookie}={value}'.format(cookie=cookie, value=value)
|
|
615
617
|
if path:
|
|
616
618
|
http_cookie += '; Path=' + path
|
|
@@ -40,8 +40,9 @@ class FormDataIter:
|
|
|
40
40
|
def __init__(self, request):
|
|
41
41
|
self.request = request
|
|
42
42
|
self.buffer = None
|
|
43
|
+
content_type = request.content_type or ''
|
|
43
44
|
try:
|
|
44
|
-
mimetype, boundary =
|
|
45
|
+
mimetype, boundary = content_type.rsplit('; boundary=', 1)
|
|
45
46
|
except ValueError:
|
|
46
47
|
return # not a multipart request
|
|
47
48
|
if mimetype.split(';', 1)[0] == \
|
|
@@ -39,7 +39,6 @@ docs/extensions/websocket.rst
|
|
|
39
39
|
docs/implementation/freezing.rst
|
|
40
40
|
docs/implementation/index.rst
|
|
41
41
|
docs/implementation/migrating.rst
|
|
42
|
-
docs/implementation/type_hints.rst
|
|
43
42
|
docs/users-guide/concurrency.rst
|
|
44
43
|
docs/users-guide/defining-routes.rst
|
|
45
44
|
docs/users-guide/index.rst
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -172,6 +172,20 @@ class TestMultipart(unittest.TestCase):
|
|
|
172
172
|
self.assertEqual(res.status_code, 200)
|
|
173
173
|
self.assertEqual(res.text, 'None')
|
|
174
174
|
|
|
175
|
+
def test_no_content_type(self):
|
|
176
|
+
app = Microdot()
|
|
177
|
+
|
|
178
|
+
@app.route('/async', methods=['GET', 'POST'])
|
|
179
|
+
@with_form_data
|
|
180
|
+
async def async_route(req):
|
|
181
|
+
return str(req.form)
|
|
182
|
+
|
|
183
|
+
client = TestClient(app)
|
|
184
|
+
|
|
185
|
+
res = self._run(client.get('/async'))
|
|
186
|
+
self.assertEqual(res.status_code, 200)
|
|
187
|
+
self.assertEqual(res.text, 'None')
|
|
188
|
+
|
|
175
189
|
def test_upload_iterator(self):
|
|
176
190
|
app = Microdot()
|
|
177
191
|
|
|
@@ -201,6 +201,8 @@ class TestResponse(unittest.TestCase):
|
|
|
201
201
|
domain='example.com\r\nSet-Cookie: foo2=bar2')
|
|
202
202
|
with self.assertRaises(ValueError):
|
|
203
203
|
res.set_cookie('foo1', 'bar1', path='/\r\nSet-Cookie: foo2=bar2')
|
|
204
|
+
with self.assertRaises(ValueError):
|
|
205
|
+
res.set_cookie('foo10', 'x;y', path='/')
|
|
204
206
|
self.assertEqual(res.headers, {'Set-Cookie': [
|
|
205
207
|
'foo1=bar1',
|
|
206
208
|
'foo2=bar2; Path=/; Partitioned',
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Type Hints
|
|
2
|
-
~~~~~~~~~~
|
|
3
|
-
|
|
4
|
-
Since version 2.6.0, Microdot includes standard Python type hints for all
|
|
5
|
-
public classes, methods, attributes and functions. This allows IDEs such as
|
|
6
|
-
Visual Studio Code, PyCharm and Vim/Neovim to provide type information and
|
|
7
|
-
autocompletion functions as you type.
|
|
8
|
-
|
|
9
|
-
Type hints are provided in standard stub files with the *.pyi* extension.
|
|
10
|
-
Install Microdot with ``pip``, ``uv`` or your favorite installer to have these
|
|
11
|
-
added to your virtual environment.
|
|
12
|
-
|
|
13
|
-
.. note::
|
|
14
|
-
The *.pyi* stub files are only meant to be used on your computer, to help
|
|
15
|
-
your IDE provide better coding assistance while you type. It is not
|
|
16
|
-
necessary to copy these files to your MicroPython device.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|