Skip to content

Commit

Permalink
feat: Maybe stop XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHorwitz committed Sep 29, 2024
1 parent d77b644 commit b19567d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"clsx": "^2.1.1",
"cypress-file-upload": "^5.0.8",
"framer-motion": "^11.3.30",
"he": "^1.2.0",
"input-otp": "^1.2.4",
"jwt-decode": "^4.0.0",
"lucide-react": "^0.412.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/archive/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import { useRef } from "react";
import SearchFilters from "./filters";
import { Badge } from "@/components/ui/badge";
import { escape } from "querystring";

const searchSchema = z.object({
q: z.string().optional(),
Expand Down Expand Up @@ -85,7 +86,7 @@ export default async function ArchiveSearch({ searchParams }: { searchParams: un
if (!params.q) {
redirect("/archive");
}

params.q = escape(params.q)
const { data, error } = await searchArchive({
search: params.q,
offset: params.offset * PAGE_SIZE,
Expand Down

0 comments on commit b19567d

Please sign in to comment.