Do not overwrite established content-type headers for read stream deliver #66

Merged
merged 1 commit into from Aug 22, 2011

Projects

None yet

2 participants

@voodootikigod
Contributor

Do not overwrite established content-type headers for read stream deliveries. Affects any and all upper libraries (e.g. cloudfiles)

@mikeal mikeal commented on the diff Aug 22, 2011
@@ -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'])
@mikeal
mikeal Aug 22, 2011 Member

it really sucks that we have to do this case lookup. i should put in a ticket to core about making this less annoying.

@mikeal mikeal merged commit 57b3d60 into request:master Aug 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment