Skip to content

Commit

Permalink
Merge tag '3.18.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Dec 13, 2014
2 parents 4d80933 + 4405b84 commit 4aa2801
Show file tree
Hide file tree
Showing 41 changed files with 255 additions and 211 deletions.
20 changes: 20 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
unreleased
==========

* Fix exception in `req.fresh`/`req.stale` without response headers

4.10.5 / 2014-12-10
===================

Expand Down Expand Up @@ -608,6 +613,21 @@
- `app.route()` - Proxy to the app's `Router#route()` method to create a new route
- Router & Route - public API

3.18.6 / 2014-12-12
===================

* Fix exception in `req.fresh`/`req.stale` without response headers

3.18.5 / 2014-12-11
===================

* deps: connect@2.27.6
- deps: compression@~1.2.2
- deps: express-session@~1.9.3
- deps: http-errors@~1.2.8
- deps: serve-index@~1.5.3
- deps: type-is@~1.5.4

3.18.4 / 2014-11-23
===================

Expand Down
5 changes: 2 additions & 3 deletions examples/error-pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var silent = 'test' == process.env.NODE_ENV;

// general config
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('view engine', 'ejs');

// our custom "verbose errors" setting
// which we can use in the templates
Expand All @@ -25,7 +25,7 @@ silent || app.use(logger('dev'));
// Routes

app.get('/', function(req, res){
res.render('index.jade');
res.render('index.ejs');
});

app.get('/404', function(req, res, next){
Expand Down Expand Up @@ -96,7 +96,6 @@ app.use(function(err, req, res, next){
res.render('500', { error: err });
});


/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
Expand Down
3 changes: 3 additions & 0 deletions examples/error-pages/views/404.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% include error_header %>
<h2>Cannot find <%= url %></h2>
<% include footer %>
5 changes: 0 additions & 5 deletions examples/error-pages/views/404.jade

This file was deleted.

8 changes: 8 additions & 0 deletions examples/error-pages/views/500.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% include error_header %>
<h2>Error: <%= error.message %></h2>
<% if (settings['verbose errors']) { %>
<pre><%= error.stack %></pre>
<% } else { %>
<p>An error occurred!</p>
<% } %>
<% include footer %>
13 changes: 0 additions & 13 deletions examples/error-pages/views/500.jade

This file was deleted.

6 changes: 0 additions & 6 deletions examples/error-pages/views/error.jade

This file was deleted.

8 changes: 8 additions & 0 deletions examples/error-pages/views/error_header.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
</head>

<body>
<h1>An error occurred!</h1>
2 changes: 2 additions & 0 deletions examples/error-pages/views/footer.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
</body>
</html>
18 changes: 18 additions & 0 deletions examples/error-pages/views/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Custom Pages Example</title>
</head>

<body>
<h1>My Site</h1>
<h2>Pages Example</h2>

<ul>
<li>visit <a href="/500">500</a></li>
<li>visit <a href="/404">404</a></li>
<li>visit <a href="/403">403</a></li>
</ul>

</body>
</html>
15 changes: 0 additions & 15 deletions examples/error-pages/views/index.jade

This file was deleted.

6 changes: 0 additions & 6 deletions examples/error-pages/views/layout.jade

This file was deleted.

2 changes: 2 additions & 0 deletions examples/mvc/controllers/pet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

var db = require('../../db');

exports.engine = 'ejs';

exports.before = function(req, res, next){
var pet = db.pets[req.params.pet_id];
if (!pet) return next('route');
Expand Down
15 changes: 15 additions & 0 deletions examples/mvc/controllers/pet/views/edit.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/style.css">
<title>Edit <%= pet.name %></title>
</head>

<body>
<h1><%= pet.name %></h1>
<form action="/pet/<%= pet.id %>?_method=put" method="post">
<label>Name: <input type="text" name="user[name]" value="<%= pet.name %>"></label>
<input type="submit" value="Update">
</form>
</body>
</html>
6 changes: 0 additions & 6 deletions examples/mvc/controllers/pet/views/edit.jade

This file was deleted.

13 changes: 13 additions & 0 deletions examples/mvc/controllers/pet/views/show.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/style.css">
<title><%= pet.name %></title>
</head>

<body>
<h1><%= pet.name %> <a href="/pet/<%= pet.id %>/edit">edit</a></h1>

<p>You are viewing <%= pet.name %></p>
</body>
</html>
6 changes: 0 additions & 6 deletions examples/mvc/controllers/pet/views/show.jade

This file was deleted.

2 changes: 1 addition & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ defineGetter(req, 'fresh', function(){

// 2xx or 304 as per rfc2616 14.26
if ((s >= 200 && s < 300) || 304 == s) {
return fresh(this.headers, this.res._headers);
return fresh(this.headers, (this.res._headers || {}));
}

return false;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
},
"devDependencies": {
"after": "0.8.1",
"istanbul": "0.3.2",
"istanbul": "0.3.5",
"mocha": "~2.0.0",
"should": "~4.3.0",
"should": "~4.3.1",
"supertest": "~0.15.0",
"ejs": "~1.0.0",
"marked": "0.3.2",
Expand Down
65 changes: 0 additions & 65 deletions support/app.js

This file was deleted.

1 change: 0 additions & 1 deletion support/views/hello.jade

This file was deleted.

Loading

0 comments on commit 4aa2801

Please sign in to comment.