Skip to content

Commit

Permalink
chore: catch missing prism langs
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Jul 29, 2024
1 parent a691b78 commit c711112
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ValidationService {

private static final Set<String> BANNED_ROUTES = Set.of("actuator", "admin", "api", "api-docs", "authors", "guidelines", "linkout",
"logged-out", "markdown", "new", "neworganization", "notifications", "null", "organizations", "privacy", "recommended", "settings",
"staff", "terms", "tools", "tos", "undefined", "unread", "version", "paper", "velocity", "waterfall", "spigot", "mojang", "minecraft", "auth", "_nuxt");
"staff", "terms", "tools", "tos", "undefined", "unread", "version", "paper", "velocity", "waterfall", "spigot", "mojang", "minecraft", "auth", "_nuxt", "prism");
private final HangarConfig config;

public ValidationService(final HangarConfig config) {
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/server/routes/prism/[...].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// to prevent unnecessary profile loads
export default defineEventHandler((event) => {
setResponseStatus(event, 404);
return `Unknown language: ${event.context?.params?._?.replace("prism-", "")?.replace(".min.js", "")}`;
});

0 comments on commit c711112

Please sign in to comment.