Skip to content

Commit

Permalink
Do not overwrite established content-type headers for read stream del…
Browse files Browse the repository at this point in the history
…iveries.
  • Loading branch information
Chris Williams committed Aug 22, 2011
1 parent 76d8924 commit b09212f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ Request.prototype.request = function () {
if (options.ntick) throw new Error("You cannot pipe to this stream after the first nextTick() after creation of the request stream.")
options.src = src
if (isReadStream(src)) {
options.headers['content-type'] = mimetypes.lookup(src.path.slice(src.path.lastIndexOf('.')+1))
if (!options.headers['content-type'] && !options.headers['Content-Type'])
options.headers['content-type'] = mimetypes.lookup(src.path.slice(src.path.lastIndexOf('.')+1))
} else {
if (src.headers) {
for (i in src.headers) {
Expand Down

0 comments on commit b09212f

Please sign in to comment.