Skip to content

Commit 1cf10fe

Browse files
committed
add X-Accel & X-Sendfile providers
1 parent a35982d commit 1cf10fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fileprovider/middleware.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ def get_response(self, response, **options):
1515
def _get_response(self, response, **options):
1616
raise NotImplemented
1717

18-
class NginxFileProvider(FileProvider):
18+
class XAccelFileProvider(FileProvider):
1919
def _get_response(self, response, **options):
2020
response['X-Accel-Redirect'] = response['X-File']
21+
del response['X-File']
2122
return response
2223

23-
class ApacheFileProvider(FileProvider):
24+
class XSendFileProvider(FileProvider):
2425
def _get_response(self, response, **options):
2526
response['X-Sendfile'] = response['X-File']
27+
del response['X-File']
2628
return response
2729

2830
class PythonFileProvider(FileProvider):

0 commit comments

Comments
 (0)