return Err(cgi::text_response(404, "(This is the voting place. You should have been given a more specific URL for the specific thing you've been invited to vote on.)"));
}
if path == "/" {
return Err(cgi::text_response(404, "(This is the voting place. You should have been given a more specific URL for the specific thing you've been invited to vote on.)"));
}
- if path.contains("..") || !path.starts_with("/") {
+ if path.contains("..") || !path.starts_with('/') {
return Err(invalid_path());
}
let dir = Path::new(&format!("{DATA_PATH}{path}")).to_path_buf();
return Err(invalid_path());
}
let dir = Path::new(&format!("{DATA_PATH}{path}")).to_path_buf();