From df56936e59b8ac39280118639d0b98000278e858 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 11 Feb 2015 17:18:10 -0800 Subject: [PATCH] Do not generate the Not Found page if JS or CSS was requested. Cut #1 --- lib/WebGUI/Content/NotFound.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/WebGUI/Content/NotFound.pm b/lib/WebGUI/Content/NotFound.pm index b42c49fbf..dac37d085 100644 --- a/lib/WebGUI/Content/NotFound.pm +++ b/lib/WebGUI/Content/NotFound.pm @@ -48,6 +48,12 @@ sub handler { my ($session) = @_; $session->http->setStatus("404","Page Not Found"); my $output = ""; + my $requestedUrl = $session->url->getRequestedUrl; + ##If they requested some snippet that doesn't exist any longer, then just + ##return an empty string instead of generating the whole not found page. + if ($requestedUrl =~ /\.(?:js|css)$/) { + return ''; + } my $notFound = WebGUI::Asset->getNotFound($session); if (defined $notFound) { $session->asset($notFound);