add back /edit/ handler and specify ES6 quote chars for jsmin
This commit is contained in:
parent
a46a44db26
commit
584e27139e
@ -40,8 +40,6 @@ require(["ace/ace", "ace/ext/settings_menu"], function (ace) {
|
||||
},
|
||||
readOnly: true
|
||||
}]);
|
||||
|
||||
|
||||
});
|
||||
|
||||
let filename = location.hash.substring(1);
|
||||
|
@ -1013,6 +1013,16 @@ static bool _reply(socketpool_socket_obj_t *socket, _request *request) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (strcmp(request->path, "/edit/") == 0) {
|
||||
if (!request->authenticated) {
|
||||
if (_api_password[0] != '\0') {
|
||||
_reply_unauthorized(socket, request);
|
||||
} else {
|
||||
_reply_forbidden(socket, request);
|
||||
}
|
||||
} else {
|
||||
_REPLY_STATIC(socket, request, edit_html);
|
||||
}
|
||||
} else if (memcmp(request->path, "/cp/", 4) == 0) {
|
||||
const char *path = request->path + 3;
|
||||
if (strcmp(request->method, "GET") != 0) {
|
||||
|
@ -29,7 +29,9 @@ for f in args.files:
|
||||
if f.name.endswith(".html"):
|
||||
uncompressed = minify_html.minify(uncompressed.decode("utf-8")).encode("utf-8")
|
||||
elif f.name.endswith(".js"):
|
||||
uncompressed = jsmin.jsmin(uncompressed.decode("utf-8")).encode("utf-8")
|
||||
uncompressed = jsmin.jsmin(uncompressed.decode("utf-8"), quote_chars="'\"`").encode(
|
||||
"utf-8"
|
||||
)
|
||||
compressed = gzip.compress(uncompressed)
|
||||
clen = len(compressed)
|
||||
compressed = ", ".join([hex(x) for x in compressed])
|
||||
|
Loading…
Reference in New Issue
Block a user