comparison tincan.py @ 41:9335865ae0bb draft

Fix bug.
author David Barts <n5jrn@me.com>
date Wed, 29 May 2019 09:47:27 -0700
parents df27cf08c093
children 8948020c54fd
comparison
equal deleted inserted replaced
40:df27cf08c093 41:9335865ae0bb
447 headers["Content-Encoding"] = self._encoding 447 headers["Content-Encoding"] = self._encoding
448 # Support the If-Modified-Since request header. 448 # Support the If-Modified-Since request header.
449 ims = bottle.request.environ.get('HTTP_IF_MODIFIED_SINCE') 449 ims = bottle.request.environ.get('HTTP_IF_MODIFIED_SINCE')
450 if ims: 450 if ims:
451 ims = self._parse_date(ims.split(";")[0].strip()) 451 ims = self._parse_date(ims.split(";")[0].strip())
452 if ims is not None and ims >= int(stats.st_mtime): 452 if ims is not None and ims >= int(mtime):
453 headers["Content-Length"] = "0" 453 headers["Content-Length"] = "0"
454 return bottle.HTTPResponse(body=b"", status=304, headers=headers) 454 return bottle.HTTPResponse(body=b"", status=304, headers=headers)
455 # Standard response. 455 # Standard response.
456 headers["Content-Length"] = str(len(bytes)) 456 headers["Content-Length"] = str(len(bytes))
457 return bottle.HTTPResponse(body=bytes, status=200, headers=headers) 457 return bottle.HTTPResponse(body=bytes, status=200, headers=headers)