Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fbed286e4 | ||
|
|
e4ff70cf8f |
12
microdot.py
12
microdot.py
@@ -1,5 +1,11 @@
|
|||||||
import json
|
try:
|
||||||
import re
|
import ujson as json
|
||||||
|
except ImportError:
|
||||||
|
import json
|
||||||
|
try:
|
||||||
|
import ure as re
|
||||||
|
except ImportError:
|
||||||
|
import re
|
||||||
try:
|
try:
|
||||||
import usocket as socket
|
import usocket as socket
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@@ -49,7 +55,6 @@ class Request():
|
|||||||
if line == '':
|
if line == '':
|
||||||
break
|
break
|
||||||
header, value = line.split(':', 1)
|
header, value = line.split(':', 1)
|
||||||
header = header.title()
|
|
||||||
value = value.strip()
|
value = value.strip()
|
||||||
self.headers[header] = value
|
self.headers[header] = value
|
||||||
if header == 'Content-Length':
|
if header == 'Content-Length':
|
||||||
@@ -146,7 +151,6 @@ class Response():
|
|||||||
content_length_found = False
|
content_length_found = False
|
||||||
content_type_found = False
|
content_type_found = False
|
||||||
for header, value in self.headers.items():
|
for header, value in self.headers.items():
|
||||||
header = header.title()
|
|
||||||
values = value if isinstance(value, list) else [value]
|
values = value if isinstance(value, list) else [value]
|
||||||
for value in values:
|
for value in values:
|
||||||
client_stream.write('{header}: {value}\r\n'.format(
|
client_stream.write('{header}: {value}\r\n'.format(
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -8,14 +8,14 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='microdot',
|
name='microdot',
|
||||||
version='0.1.0',
|
version='0.1.1',
|
||||||
url='http://github.com/miguelgrinberg/microdot/',
|
url='http://github.com/miguelgrinberg/microdot/',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
author='Miguel Grinberg',
|
author='Miguel Grinberg',
|
||||||
author_email='miguel.grinberg@gmail.com',
|
author_email='miguel.grinberg@gmail.com',
|
||||||
description='Impossibly small web framework for MicroPython',
|
description='Impossibly small web framework for MicroPython',
|
||||||
long_description=__doc__,
|
long_description=__doc__,
|
||||||
packages=['microdot'],
|
py_modules=['microdot'],
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
platforms='any',
|
platforms='any',
|
||||||
|
|||||||
Reference in New Issue
Block a user