aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.py
diff options
context:
space:
mode:
authorkj_sh6042026-03-15 13:58:33 -0400
committerkj_sh6042026-03-15 13:58:33 -0400
commit006d7797ac27739e1adb500749e384c0006ba00a (patch)
tree1270a8de175e204012c499c7050576df825af754 /src/server.py
parent3f5a405eb8c5b4bd6eb3a118bc370f641aca8299 (diff)
refactor: multiple fixes and features
Diffstat (limited to 'src/server.py')
-rw-r--r--src/server.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/server.py b/src/server.py
index fe4537b..4653af4 100644
--- a/src/server.py
+++ b/src/server.py
@@ -41,6 +41,10 @@ ALLOWED_LANGUAGES = {
"abnf",
"accesslog",
"ada",
+ "angelscript",
+ "apache",
+ "applescript",
+ "arcade",
"arduino",
"armasm",
"asciidoc",
@@ -118,6 +122,7 @@ ALLOWED_LANGUAGES = {
"jboss-cli",
"json",
"julia",
+ "julia-repl",
"kotlin",
"lasso",
"latex",
@@ -209,6 +214,7 @@ ALLOWED_LANGUAGES = {
"vala",
"vbnet",
"vbscript",
+ "vbscript-html",
"verilog",
"vhdl",
"vim",
@@ -653,6 +659,20 @@ class ClipboardHandler(http.server.BaseHTTPRequestHandler):
self.send_html(200, landing_page())
return
+ if path == "/main.js":
+ js_path = BASE_DIR / "main.js"
+ if not js_path.exists():
+ self.send_plain(404, "not found")
+ return
+ data = js_path.read_bytes()
+ self.send_response(200)
+ self.send_header("Content-Type", "application/javascript; charset=utf-8")
+ self.send_header("Content-Length", str(len(data)))
+ self.add_security_headers()
+ self.end_headers()
+ self.wfile.write(data)
+ return
+
if path.startswith("/raw/"):
paste_id = path[5:]
if not is_valid_paste_id(paste_id):