Files
minisrv/zefie_wtvp_minisrv/ServiceVault/wtv-disk/userstore.js
zefie b96718555b v0.9.18
- numerous bug fixes
 - too much to remember
   - rewrote sync system yet again
   - more classes
      - WTVShared class for shared functions
      - clientShowAlert class for easy client:showalert urls
    - User File Store
      - Can upload with PUT commands in wtv-disk
      - Programmically access files with new functions in WTVClientSessionData
      - TODO: file browser
    - other stuff I can't remember
  - work on post data bug
  - 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
  - update to v90 modem firmware
    - offer kflex with `Old` diskmap
2022-11-29 08:27:58 -05:00

21 lines
896 B
JavaScript

if (request_headers.post_data) {
if (request_headers.query.partialPath || request_headers.query.path) {
if (socket.ssid) {
if (ssid_sessions[socket.ssid]) {
if (ssid_sessions[socket.ssid].isRegistered()) {
var result = ssid_sessions[socket.ssid].storeUserStoreFile(request_headers.query.path || request_headers.query.partialPath, new Buffer.from(request_headers.post_data.toString(CryptoJS.enc.Hex), 'hex'), request_headers.query['last-modified-seconds'] || null, (request_headers.query.no_overwrite) ? false : true);
if (result) {
headers = "200 OK\n";
headers += "Content-Type: text/plain";
}
}
}
}
}
}
if (!headers) {
var errpage = doErrorPage(400)
headers = errpage[0];
data = errpage[1];
}