From 8473f2f2d96d77219e6a3d5431dff5f7d2ae94a5 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Wed, 24 Aug 2022 16:09:58 -0400 Subject: [PATCH] Throw 404 if you request List page that doesn't exist --- PostText.pl | 2 ++ README.md | 1 + 2 files changed, 3 insertions(+) diff --git a/PostText.pl b/PostText.pl index 9abf0ee..ac7cb0f 100755 --- a/PostText.pl +++ b/PostText.pl @@ -50,6 +50,8 @@ group { my $last_page = $c->thread->get_last_page(); my $threads = $c->thread->get_threads_by_page($this_page); + $c->stash(status => 404) unless $threads->[0]; + $c->stash( threads => $threads, this_page => $this_page, diff --git a/README.md b/README.md index ee64079..9b9b141 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,4 @@ Run the tests locally (against development environment) 1. Return the last remark with remark form 1. Marked some items for clean up with comments 1. Method names may need to be shortened +1. Probably throw a 404 if you request a remark page that doesn't exist