Skip to content

Commit e76e306

Browse files
committed
Fix api
1 parent 59d9789 commit e76e306

File tree

1 file changed

+3
-2
lines changed
  • cornucopia.owasp.org/src/routes/api/cre/[edition]

1 file changed

+3
-2
lines changed

cornucopia.owasp.org/src/routes/api/cre/[edition]/+server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { CreController } from '$domain/cre/creController';
44

55
export const prerender = false;
66

7-
export const GET: RequestHandler = ({ params }) => {
8-
const edition = params.edition;
7+
export const GET: RequestHandler = ({ url }) => {
8+
const params = url.pathname.split('/');
9+
const edition = params[params.length - 1];
910

1011
// V16.5: Fail securely by terminating handler on invalid edition
1112
if (!edition || !DeckService.hasEdition(edition)) {

0 commit comments

Comments
 (0)