Also provide the correct mime type to speed up the parsing.
This commit is contained in:
parent
df56936e59
commit
6028535303
1 changed files with 8 additions and 1 deletions
|
|
@ -51,7 +51,14 @@ sub handler {
|
||||||
my $requestedUrl = $session->url->getRequestedUrl;
|
my $requestedUrl = $session->url->getRequestedUrl;
|
||||||
##If they requested some snippet that doesn't exist any longer, then just
|
##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.
|
##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 '';
|
return '';
|
||||||
}
|
}
|
||||||
my $notFound = WebGUI::Asset->getNotFound($session);
|
my $notFound = WebGUI::Asset->getNotFound($session);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue