Permalink
Browse files

fix favicon path in static module

  • Loading branch information...
Grigore147 committed Jan 10, 2013
1 parent 96c016e commit 758dd6728fd7efc5be2da32953381c90fb6618cf
Showing with 19 additions and 14 deletions.
  1. +17 −13 lib/static.js
  2. +2 −1 template/application/config/development/application.js
View
@@ -2,22 +2,26 @@ var server = new (require('node-static').Server)('./');
var config = App.Config();
+if (config.static.error_log === undefined) {
+ config.static.error_log = false;
+}
+
App.on('connection', function(request, response, callback) {
if (request.url == '/favicon.ico') {
- request.url = config.static.path + 'favicon.ico';
+ request.url = '/'+ config.static.path + 'favicon.ico';
}
-
+
if (config.static.enabled && request.url.indexOf('/'+ config.static.path)===0) {
- server.serve(request, response, function(error, resp) {
- if (error) {
- error.url = request.url;
-
- console.log(error);
- }
- });
-
- return callback(true);
+ server.serve(request, response, function(error, resp) {
+ if (error) {
+ error.url = request.url;
+
+ config.static.error_log && console.log(error);
+ }
+ });
+
+ return callback(true);
}
-
+
callback();
-});
+});
@@ -55,6 +55,7 @@ module.exports = {
max_age: 0,
hiddens: false,
- get_only: true
+ get_only: true,
+ error_log: false
}
}

0 comments on commit 758dd67

Please sign in to comment.