Skip to content

Commit 3f7d63d

Browse files
committed
whitelist more files
1 parent 04b6724 commit 3f7d63d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,23 @@ async fn post_encrypted(_req: Request, ctx: RouteContext<()>) -> Result<Response
123123
Response::redirect(redirect_url)
124124
}
125125

126-
static DELETE_WHITELIST: [&str; 7] = [
126+
static DELETE_WHITELIST: [&str; 9] = [
127127
"/",
128128
"term.js",
129129
"term.css",
130130
"term.html",
131131
"jquery.js",
132132
"highlight.html",
133133
"search.html",
134+
"prism.js",
135+
"prism.css",
134136
];
135137

136138
async fn delete(_req: Request, ctx: RouteContext<()>) -> Result<Response> {
137139
let empty_string = String::new();
138140
let file = ctx.param("file").unwrap_or_else(|| &empty_string).as_str();
139141
if DELETE_WHITELIST.contains(&file) {
140-
return Response::ok("this file is protected");
142+
return Response::error("this file is protected", 403);
141143
}
142144
let _result = ctx
143145
.kv("pastebin")

0 commit comments

Comments
 (0)