File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -183,16 +183,16 @@ def get_upload(filename):
183
183
response .headers ["Content-Disposition" ] = f"attachment; filename={ filename } "
184
184
response .content_length = fileobj .length
185
185
response .last_modified = fileobj .upload_date
186
- response .cache_control .max_age = cache_for
187
- response .cache_control .public = True
188
- response .make_conditional (request )
189
186
190
187
# Get or compute the sha1 sum for the etag.
191
188
metadata = fileobj .metadata
192
189
sha1_sum = metadata and metadata .get ("sha1_sum" )
193
190
sha1_sum = sha1_sum or self ._compute_sha (fileobj )
194
191
response .set_etag (sha1_sum )
195
192
193
+ response .cache_control .max_age = cache_for
194
+ response .cache_control .public = True
195
+ response .make_conditional (request )
196
196
return response
197
197
198
198
def save_file (
Original file line number Diff line number Diff line change @@ -33,5 +33,5 @@ def setUp(self):
33
33
def tearDown (self ):
34
34
assert self .mongo .cx is not None
35
35
self .mongo .cx .drop_database (self .dbname )
36
-
36
+ self . mongo . cx . close ()
37
37
super ().tearDown ()
You can’t perform that action at this time.
0 commit comments