Comparar commits
10 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| d9aa7c3bc9 | |||
| 986fac583b | |||
| c6d76086e2 | |||
| e2771364eb | |||
| 0d5a63798b | |||
| 7d15e2bf52 | |||
| 31fef407b6 | |||
| 6bef3ef891 | |||
| b806846049 | |||
| bc16020976 |
@@ -1,4 +1,10 @@
|
||||
|
||||
2.3.4 / 2011-05-08
|
||||
==================
|
||||
|
||||
* Added `./examples/say`
|
||||
* Fixed `res.sendfile()` bug preventing the transfer of files with spaces
|
||||
|
||||
2.3.3 / 2011-05-03
|
||||
==================
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ var fs = require('fs')
|
||||
* Framework version.
|
||||
*/
|
||||
|
||||
var version = '2.3.3';
|
||||
var version = '2.3.4';
|
||||
|
||||
/**
|
||||
* Add session support.
|
||||
|
||||
+1
-1
@@ -355,7 +355,7 @@ are available as <code>req.params</code>.</p>
|
||||
});
|
||||
</code></pre>
|
||||
|
||||
<p>A route is simple a string which is compiled to a <em>RegExp</em> internally. For example
|
||||
<p>A route is simply a string which is compiled to a <em>RegExp</em> internally. For example
|
||||
when <em>/user/:id</em> is compiled, a simplified version of the regexp may look similar to:</p>
|
||||
|
||||
<pre><code>\/user\/([^\/]+)\/?
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
// Expose modules in ./support for demo purposes
|
||||
require.paths.unshift(__dirname + '/../../support');
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var express = require('../../')
|
||||
, path = require('path')
|
||||
, exec = require('child_process').exec
|
||||
, fs = require('fs');
|
||||
|
||||
/**
|
||||
* Error handler.
|
||||
*/
|
||||
|
||||
function errorHandler(voice) {
|
||||
return function(err, req, res, next) {
|
||||
var parts = err.stack.split('\n')[1].split(/[()]/)[1].split(':')
|
||||
, filename = parts.shift()
|
||||
, basename = path.basename(filename)
|
||||
, lineno = parts.shift()
|
||||
, col = parts.shift()
|
||||
, lines = fs.readFileSync(filename, 'utf8').split('\n')
|
||||
, line = lines[lineno - 1].replace(/\./, ' ');
|
||||
|
||||
exec('say -v "' + voice + '" '
|
||||
+ err.message
|
||||
+ ' on line ' + lineno
|
||||
+ ' of ' + basename + '.'
|
||||
+ ' The contents of this line is '
|
||||
+ ' "' + line + '".');
|
||||
|
||||
res.send(500);
|
||||
}
|
||||
}
|
||||
|
||||
var app = express.createServer();
|
||||
|
||||
app.get('/', function(request, response){
|
||||
if (request.is(foo)) response.end('bar');
|
||||
});
|
||||
|
||||
app.use(errorHandler('Vicki'));
|
||||
|
||||
app.listen(3000);
|
||||
+1
-1
@@ -28,7 +28,7 @@ var exports = module.exports = connect.middleware;
|
||||
* Framework version.
|
||||
*/
|
||||
|
||||
exports.version = '2.3.3';
|
||||
exports.version = '2.3.4';
|
||||
|
||||
/**
|
||||
* Shortcut for `new Server(...)`.
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ res.sendfile = function(path, options, fn){
|
||||
options = {};
|
||||
}
|
||||
|
||||
options.path = path;
|
||||
options.path = encodeURIComponent(path);
|
||||
options.callback = fn;
|
||||
send(this.req, this, next, options);
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "express",
|
||||
"description": "Sinatra inspired web development framework",
|
||||
"version": "2.3.3",
|
||||
"version": "2.3.4",
|
||||
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"contributors": [
|
||||
{ "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" },
|
||||
|
||||
+1
-1
Submodule support/connect updated: af32d828a3...76816734b8
@@ -0,0 +1 @@
|
||||
hello
|
||||
@@ -544,6 +544,10 @@ module.exports = {
|
||||
assert.equal(null, res.headers['content-disposition']);
|
||||
});
|
||||
|
||||
assert.response(app,
|
||||
{ url: '/some%20random%20text%20file.txt' },
|
||||
{ body: 'hello' });
|
||||
|
||||
beforeExit(function(){
|
||||
calls.should.equal(1);
|
||||
});
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário