Set urlPath var earlier

master
pictuga 2013-11-09 18:43:16 +01:00
parent 4ece739722
commit e5fc9786f6
1 changed files with 8 additions and 6 deletions

View File

@ -525,14 +525,20 @@ if __name__ == '__main__':
if 'REQUEST_URI' in os.environ:
HOLD = True
if 'HTTP_IF_NONE_MATCH' in os.environ and not options.force:
if time.time() - int(os.environ['HTTP_IF_NONE_MATCH'][1:-1]) < DELAY:
if 'HTTP_IF_NONE_MATCH' in os.environ:
if not options.force and time.time() - int(os.environ['HTTP_IF_NONE_MATCH'][1:-1]) < DELAY:
print 'Status: 304'
print
log(url)
log('etag good')
sys.exit(0)
cachePath = os.getcwd() + '/cache'
else:
cachePath = os.path.expanduser('~') + '/.cache/morss'
if 'REQUEST_URI' in os.environ:
print 'Status: 200'
print 'ETag: "%s"' % int(time.time())
@ -548,10 +554,6 @@ if __name__ == '__main__':
HOLD = False
cachePath = os.getcwd() + '/cache'
else:
cachePath = os.path.expanduser('~') + '/.cache/morss'
if url is None:
print 'Please provide url.'
sys.exit(1)