Skip to content

Commit

Permalink
Bundling mime module rather than keep around our own mime-map.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeal committed Aug 29, 2012
1 parent b211200 commit 1268195
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 155 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ var http = require('http')
, util = require('util')
, stream = require('stream')
, qs = require('querystring')
, mimetypes = require('./mimetypes')
, oauth = require('./oauth')
, uuid = require('./uuid')
, ForeverAgent = require('./forever')
Expand All @@ -29,6 +28,7 @@ var http = require('http')
, tunnel = require('./tunnel')
, aws = require('./aws')

, mime = require('mime')
, FormData = require('form-data')
;

Expand Down Expand Up @@ -336,7 +336,7 @@ Request.prototype.init = function (options) {
self.src = src
if (isReadStream(src)) {
if (!self.headers['content-type'] && !self.headers['Content-Type'])
self.headers['content-type'] = mimetypes.lookup(src.path.slice(src.path.lastIndexOf('.')+1))
self.headers['content-type'] = mime.lookup(src.path)
} else {
if (src.headers) {
for (var i in src.headers) {
Expand Down
152 changes: 0 additions & 152 deletions mimetypes.js

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test-pipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ s.listen(s.port, function () {
})
s.on('/pushjs', function (req, resp) {
if (req.method === "PUT") {
assert.equal(req.headers['content-type'], 'text/javascript');
assert.equal(req.headers['content-type'], 'application/javascript');
check();
}
})
Expand Down

0 comments on commit 1268195

Please sign in to comment.