Comparar commits
17 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| bef6f208d1 | |||
| 2802221243 | |||
| 3ff35d74ee | |||
| 1523b61723 | |||
| ff712f311d | |||
| 9e04488eb1 | |||
| 314238f84f | |||
| 16f925f284 | |||
| 6fab7b53db | |||
| f4a15b2aed | |||
| 4d92fb76f3 | |||
| 4e827a12b1 | |||
| 343dd28429 | |||
| 51a4881731 | |||
| 8c3ad12386 | |||
| c4bfd0e990 | |||
| 38c759be55 |
@@ -1,4 +1,22 @@
|
||||
|
||||
1.0.9 / 2011-03-01
|
||||
==================
|
||||
|
||||
* Fixed `SlowBuffer` support for `res.send()`.
|
||||
|
||||
1.0.8 / 2011-03-01
|
||||
==================
|
||||
|
||||
* Allow `req.query` to be pre-defined (via middleware or other parent app)
|
||||
* "connect": ">= 0.5.0 < 1.0.0". Closes #547
|
||||
* Removed the long deprecated __EXPRESS_ENV__ support
|
||||
|
||||
1.0.7 / 2011-02-07
|
||||
==================
|
||||
|
||||
* Fixed `render()` setting inheritance.
|
||||
Mounted apps would not inherit "view engine"
|
||||
|
||||
1.0.6 / 2011-02-07
|
||||
==================
|
||||
|
||||
|
||||
+12
-2
@@ -8,11 +8,21 @@ var fs = require('fs')
|
||||
, sys = require('sys')
|
||||
, exec = require('child_process').exec;
|
||||
|
||||
/**
|
||||
* COMPAT: constants
|
||||
*/
|
||||
|
||||
try {
|
||||
var constants = require('constants');
|
||||
} catch (err) {
|
||||
var constants = process;
|
||||
}
|
||||
|
||||
/**
|
||||
* Framework version.
|
||||
*/
|
||||
|
||||
var version = '1.0.6';
|
||||
var version = '1.0.8';
|
||||
|
||||
/**
|
||||
* stdin stream.
|
||||
@@ -352,7 +362,7 @@ function createApplicationAt(path) {
|
||||
|
||||
function emptyDirectory(path, fn) {
|
||||
fs.readdir(path, function(err, files){
|
||||
if (err && err.errno !== process.ENOENT) throw err;
|
||||
if (err && err.errno !== constants.ENOENT) throw err;
|
||||
fn(!files || !files.length);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ var exports = module.exports = require('connect').middleware;
|
||||
* Framework version.
|
||||
*/
|
||||
|
||||
exports.version = '1.0.6';
|
||||
exports.version = '1.0.9';
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
|
||||
@@ -74,7 +74,7 @@ http.ServerResponse.prototype.send = function(body, headers, status){
|
||||
}
|
||||
break;
|
||||
case 'object':
|
||||
if (body instanceof Buffer) {
|
||||
if (Buffer.isBuffer(body)) {
|
||||
if (!this.headers['Content-Type']) {
|
||||
this.contentType('.bin');
|
||||
}
|
||||
@@ -83,7 +83,7 @@ http.ServerResponse.prototype.send = function(body, headers, status){
|
||||
this.contentType('.json');
|
||||
}
|
||||
body = JSON.stringify(body);
|
||||
if (this.req.query.callback && this.app.settings['jsonp callback']) {
|
||||
if (this.req.query.callback && this.app.set('jsonp callback')) {
|
||||
this.header('Content-Type', 'text/javascript');
|
||||
body = this.req.query.callback.replace(/[^\w$.]/g, '') + '(' + body + ');';
|
||||
}
|
||||
@@ -93,7 +93,7 @@ http.ServerResponse.prototype.send = function(body, headers, status){
|
||||
|
||||
// Populate Content-Length
|
||||
if (!this.headers['Content-Length']) {
|
||||
this.header('Content-Length', body instanceof Buffer
|
||||
this.header('Content-Length', Buffer.isBuffer(body)
|
||||
? body.length
|
||||
: Buffer.byteLength(body));
|
||||
}
|
||||
|
||||
+1
-10
@@ -37,21 +37,12 @@ var Server = exports = module.exports = function Server(middleware){
|
||||
// Default "home" to /
|
||||
this.set('home', '/');
|
||||
|
||||
// DEPRECATED: remove in 1.0
|
||||
if (process.env.EXPRESS_ENV) {
|
||||
process.env.NODE_ENV = process.env.EXPRESS_ENV;
|
||||
console.warn('\x1b[33mWarning\x1b[0m: EXPRESS_ENV is deprecated, use NODE_ENV.');
|
||||
}
|
||||
|
||||
// TODO: remove when Connect removes "Server" ...
|
||||
this.showVersion = false;
|
||||
|
||||
// Set "env" to NODE_ENV, defaulting to "development"
|
||||
this.set('env', process.env.NODE_ENV || 'development');
|
||||
|
||||
// Expose objects to each other
|
||||
this.use(function(req, res, next){
|
||||
req.query = {};
|
||||
req.query = req.query || {};
|
||||
res.headers = { 'X-Powered-By': 'Express' };
|
||||
req.app = res.app = self;
|
||||
req.res = res;
|
||||
|
||||
@@ -231,8 +231,8 @@ http.ServerResponse.prototype.render = function(view, options, fn){
|
||||
|
||||
var options = options || {}
|
||||
, app = this.app
|
||||
, viewOptions = app.settings['view options']
|
||||
, defaultEngine = app.settings['view engine'];
|
||||
, viewOptions = app.set('view options')
|
||||
, defaultEngine = app.set('view engine');
|
||||
|
||||
// Mixin "view options"
|
||||
if (viewOptions) options.__proto__ = viewOptions;
|
||||
@@ -263,13 +263,13 @@ http.ServerResponse.prototype.render = function(view, options, fn){
|
||||
options.scope = options.scope || this.req;
|
||||
|
||||
// Auto-cache in production
|
||||
if ('production' == app.settings.env) {
|
||||
if ('production' == app.set('env')) {
|
||||
options.cache = true;
|
||||
}
|
||||
|
||||
// Partials support
|
||||
if (options.partial) {
|
||||
root = app.settings.partials || root + '/partials';
|
||||
root = app.set('partials') || root + '/partials';
|
||||
}
|
||||
|
||||
// View path
|
||||
|
||||
+5
-4
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "express",
|
||||
"description": "Sinatra inspired web development framework",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.9",
|
||||
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"contributors": [
|
||||
{ "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" },
|
||||
@@ -10,12 +10,13 @@
|
||||
{ "name": "Guillermo Rauch", "email": "rauchg@gmail.com" }
|
||||
],
|
||||
"dependencies": {
|
||||
"connect": ">= 0.5.0",
|
||||
"qs": ">= 0.0.2"
|
||||
"connect": ">= 0.5.0 < 1.0.0",
|
||||
"qs": ">= 0.0.5"
|
||||
},
|
||||
"keywords": ["framework", "sinatra", "web", "rest", "restful"],
|
||||
"directories": { "lib": "./lib/express" },
|
||||
"main": "index",
|
||||
"scripts": { "test": "make test" },
|
||||
"bin": { "express": "./bin/express" },
|
||||
"engines": { "node": ">= 0.2.0" }
|
||||
"engines": { "node": ">= 0.2.0 < 0.4.0" }
|
||||
}
|
||||
+1
-1
Submodule support/qs updated: 4bcae089ee...2b9796e54e
+2
-2
@@ -155,8 +155,8 @@ module.exports = {
|
||||
assert.response(app,
|
||||
{ url: '/nope' },
|
||||
function(res){
|
||||
assert.ok(res.body.indexOf('Error: ENOENT') >= 0);
|
||||
assert.ok(res.body.indexOf('nope.jade') >= 0);
|
||||
assert.ok(~res.body.indexOf('Error:'));
|
||||
assert.ok(~res.body.indexOf('nope.jade'));
|
||||
});
|
||||
|
||||
beforeExit(function(){
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário