summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Churchill <damoc@gmail.com>2009-12-09 13:13:04 +0000
committerDamien Churchill <damoc@gmail.com>2009-12-09 13:13:04 +0000
commit3d3edccdacb79fb9ad578a95d3814555c631c624 (patch)
tree7dba7ac36a7827b4fd27f2d8470d7a15bd7b4f69
parent36b2a8256102133566675278b73beab8afe6d507 (diff)
downloaddeluge-3d3edccdacb79fb9ad578a95d3814555c631c624.tar.gz
deluge-3d3edccdacb79fb9ad578a95d3814555c631c624.tar.bz2
deluge-3d3edccdacb79fb9ad578a95d3814555c631c624.zip
Apply cookie date fix from adios
-rw-r--r--ChangeLog1
-rw-r--r--deluge/ui/web/auth.py8
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ef1fae503..094b0e0f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* Swap order of buttons in Remove window (Closes #1083)
* Change the compressed js script to deluge-all.js to avoid naming
conflicts on case-sensitive filesystems.
+ * Apply patch from adios fixing the cookie date
==== GtkUI ====
* Attempt to register as the default magnet uri handler in GNOME on startup
diff --git a/deluge/ui/web/auth.py b/deluge/ui/web/auth.py
index b32e5477d..101bc628a 100644
--- a/deluge/ui/web/auth.py
+++ b/deluge/ui/web/auth.py
@@ -51,6 +51,8 @@ import time
import random
import hashlib
import logging
+from datetime import datetime, timedelta
+from email.utils import formatdate
from twisted.internet.defer import Deferred
from twisted.internet.task import LoopingCall
@@ -82,9 +84,9 @@ def get_session_id(session_id):
return None
def make_expires(timeout):
- expires = int(time.time()) + timeout
- expires_str = time.strftime('%a, %d %b %Y %H:%M:%S GMT',
- time.gmtime(expires))
+ dt = timedelta(seconds=timeout)
+ expires = time.mktime((datetime.now() + dt).timetuple())
+ expires_str = formatdate(timeval=expires, localtime=False, usegmt=True)
return expires, expires_str
class Auth(JSONComponent):