Apply cookie date fix from adios
This commit is contained in:
parent
36b2a82561
commit
3d3edccdac
@ -3,6 +3,7 @@
|
|||||||
* Swap order of buttons in Remove window (Closes #1083)
|
* Swap order of buttons in Remove window (Closes #1083)
|
||||||
* Change the compressed js script to deluge-all.js to avoid naming
|
* Change the compressed js script to deluge-all.js to avoid naming
|
||||||
conflicts on case-sensitive filesystems.
|
conflicts on case-sensitive filesystems.
|
||||||
|
* Apply patch from adios fixing the cookie date
|
||||||
|
|
||||||
==== GtkUI ====
|
==== GtkUI ====
|
||||||
* Attempt to register as the default magnet uri handler in GNOME on startup
|
* Attempt to register as the default magnet uri handler in GNOME on startup
|
||||||
|
|||||||
@ -51,6 +51,8 @@ import time
|
|||||||
import random
|
import random
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
from email.utils import formatdate
|
||||||
|
|
||||||
from twisted.internet.defer import Deferred
|
from twisted.internet.defer import Deferred
|
||||||
from twisted.internet.task import LoopingCall
|
from twisted.internet.task import LoopingCall
|
||||||
@ -82,9 +84,9 @@ def get_session_id(session_id):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def make_expires(timeout):
|
def make_expires(timeout):
|
||||||
expires = int(time.time()) + timeout
|
dt = timedelta(seconds=timeout)
|
||||||
expires_str = time.strftime('%a, %d %b %Y %H:%M:%S GMT',
|
expires = time.mktime((datetime.now() + dt).timetuple())
|
||||||
time.gmtime(expires))
|
expires_str = formatdate(timeval=expires, localtime=False, usegmt=True)
|
||||||
return expires, expires_str
|
return expires, expires_str
|
||||||
|
|
||||||
class Auth(JSONComponent):
|
class Auth(JSONComponent):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user