From f5637f65e70f79abbd0c094e66668816f2a5f937 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Wed, 24 Aug 2022 16:19:37 -0400 Subject: [PATCH] Throw some 404s --- PostText.pl | 6 ++++++ README.md | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/PostText.pl b/PostText.pl index ac7cb0f..948b4d5 100755 --- a/PostText.pl +++ b/PostText.pl @@ -151,6 +151,9 @@ group { my $remarks = $c->remark->get_remarks_by_thread_id($thread_id, $this_page); + # Probably a better way to do this 404 stuff I reckon + + # Check for existence of thread if (my $thread_body = %$thread{'body'}) { $c->stash( thread => $thread, @@ -167,6 +170,9 @@ group { ) } + # Check for existance of remark page number + $c->stash(status => 404) unless $remarks->[0] || 1 >= $this_page; + $c->render(); }; }; diff --git a/README.md b/README.md index 9b9b141..ee64079 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,3 @@ 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