Skip to content

Commit

Permalink
Merge branch 'master' of github.com:yeoman/yeoman
Browse files Browse the repository at this point in the history
* 'master' of github.com:yeoman/yeoman:
  Adding server fix for yeoman#422, yeoman#402
  • Loading branch information
paulirish committed Sep 14, 2012
2 parents 7dc5ee3 + 1e426cf commit b1bdcab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cli/tasks/server.js
Expand Up @@ -413,8 +413,7 @@ module.exports = function(grunt) {
opts = opts || {};

return function inject(req, res, next) {
var port = res.socket.server.address().port;


// build filepath from req.url and deal with index files for trailing `/`
var filepath = req.url.slice(-1) === '/' ? req.url + 'index.html' : req.url;

Expand All @@ -424,6 +423,8 @@ module.exports = function(grunt) {
return next();
}

var port = res.socket.server.address().port;

// setup some basic headers, at this point it's always text/html anyway
res.setHeader('Content-Type', connect.static.mime.lookup(filepath));

Expand Down

0 comments on commit b1bdcab

Please sign in to comment.