Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

modify a header in the test

  • Loading branch information...
commit eee53d32e1afc7b8285056cd8f54c2b96e1918e7 1 parent e73bbc6
@substack authored
Showing with 13 additions and 1 deletion.
  1. +1 −0  package.json
  2. +12 −1 test/filed.js
View
1  package.json
@@ -9,6 +9,7 @@
},
"devDependencies" : {
"tap" : "~0.3.0",
+ "event-stream" : "~3.0.2",
"filed" : "git://github.com/substack/filed.git#return_dest"
},
"scripts" : {
View
13 test/filed.js
@@ -9,7 +9,7 @@ var fs = require('fs');
var fileContents = fs.readFileSync(__dirname + '/data.txt');
test('filed response', function (t) {
- t.plan(2);
+ t.plan(3);
var port = Math.floor(Math.random() * 5e4 + 1e4);
var server = http.createServer(function (req, res) {
@@ -35,6 +35,10 @@ test('filed response', function (t) {
Number(res.headers['content-length']),
fileContents.length
);
+ t.equal(
+ res.headers['content-type'],
+ 'TEXT/PLAIN'
+ );
});
});
});
@@ -47,6 +51,13 @@ test('filed response', function (t) {
var s = responseStream(es.mapSync(function (s) {
return String(s).toUpperCase()
}));
+
+ s.on('setHeader', function (args, pass) {
+ if (args[0] === 'content-type') {
+ args[1] = String(args[1]).toUpperCase();
+ }
+ });
+
return s;
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.