Skip to content

Commit fd218b4

Browse files
author
zhanglei3
committed
Merge branch 'develop'
2 parents f10c68a + 18d8719 commit fd218b4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

litefs.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ def make_environ(app, rw, address):
206206
k = k.replace('-', '_').upper()
207207
if k in environ:
208208
continue
209-
environ['HTTP_%s' % k] = v
209+
if k.startswith('_'):
210+
environ[k] = v
211+
else:
212+
environ['HTTP_%s' % k] = v
210213
s = rw.readline(DEFAULT_BUFFER_SIZE)
211214
size = environ.pop('HTTP_CONTENT_LENGTH', None)
212215
if not size:
@@ -379,6 +382,8 @@ def __init__(self, path, base, name, text):
379382
headers = [('Content-Type', 'text/html;charset=utf-8')]
380383
if mimetype is not None:
381384
headers = [('Content-Type', '%s;charset=utf-8' % mimetype)]
385+
else:
386+
headers = [('Content-Type', 'application/octet-stream;charset=utf-8')]
382387
headers.append(('Last-Modified', self.last_modified))
383388
headers.append(('Connection', 'close'))
384389
self.headers = headers

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ greenlet==0.4.13
33
Mako==1.0.6
44
MarkupSafe==1.0
55
pathtools==0.1.2
6-
pkg-resources==0.0.0
76
PyYAML==3.12
87
watchdog==0.8.3

0 commit comments

Comments
 (0)