@ctrl/qbittorrent 7.1.0 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -542,8 +542,14 @@ export class QBittorrent {
542
542
  this._sid = cookie.SID;
543
543
  // Not sure if it might be lowercase
544
544
  const expires = cookie.Expires ?? cookie.expires;
545
- // Default expiration is expected to be 1 hour
546
- this._exp = expires ? new Date(expires) : new Date(Date.now() + 3600000);
545
+ // Assumed to be in seconds
546
+ const maxAge = cookie['Max-Age'] ?? cookie['max-age'];
547
+ this._exp = expires
548
+ ? new Date(expires)
549
+ : maxAge
550
+ ? new Date(Number(maxAge) * 1000)
551
+ : // Default expiration 1 hour
552
+ new Date(Date.now() + 3600000);
547
553
  return true;
548
554
  }
549
555
  logout() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctrl/qbittorrent",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
4
4
  "description": "TypeScript api wrapper for qbittorrent using got",
5
5
  "author": "Scott Cooper <scttcper@gmail.com>",
6
6
  "license": "MIT",