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);