lots more stuff

- proper gzip download for disk system (aka WNI reinventing the Content-Encoding: gzip wheel)
- send Last-Modified for static files
- send wtv-checksum for all disk system downloads
- other fixes
This commit is contained in:
zefie
2021-08-11 00:56:21 -04:00
parent 11935a5886
commit 95442a12af
21 changed files with 185 additions and 100 deletions

View File

@@ -103,15 +103,6 @@ class WTVClientSessionData {
return this.wtvmime.getSimpleContentType(path);
}
/**
* Returns a RFC7231 compliant UTC Date String from the current time
* @param {Number} offset Offset from current time (+/-)
* @returns {string} A RFC7231 compliant UTC Date String from the current time
*/
getUTCTime(offset = 0) {
return new Date((new Date).getTime() + offset).toUTCString();
}
/**
* Returns the number of user cookies
* @returns {number} Number of cookies
@@ -123,7 +114,7 @@ class WTVClientSessionData {
resetCookies() {
this.session_store.cookies = {};
// webtv likes to have at least one cookie in the list, set a dummy cookie for zefie's site expiring in 1 year.
this.addCookie("wtv.zefie.com", "/", this.getUTCTime(365 * 86400000), "cookie_type=chocolatechip");
this.addCookie("wtv.zefie.com", "/", this.wtvshared.getUTCTime(365 * 86400000), "cookie_type=chocolatechip");
}
addCookie(domain, path = null, expires = null, data = null) {