From 6028535303f82f0b0eb5f0d52c252d4447d40f48 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 18 Feb 2015 13:43:40 -0500 Subject: [PATCH] Also provide the correct mime type to speed up the parsing. --- lib/WebGUI/Content/NotFound.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Content/NotFound.pm b/lib/WebGUI/Content/NotFound.pm index dac37d085..e92ea11ca 100644 --- a/lib/WebGUI/Content/NotFound.pm +++ b/lib/WebGUI/Content/NotFound.pm @@ -51,7 +51,14 @@ sub handler { 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)$/) { + my $wants_js = $requestedUrl =~ /\.js$/; + my $wants_css = $requestedUrl =~ /\.css$/; + if ($wants_js) { + $session->http->setMimeType('text/javascript'); + return ''; + } + elsif ($wants_js) { + $session->http->setMimeType('text/css'); return ''; } my $notFound = WebGUI::Asset->getNotFound($session);