Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 22, 2011

Conversation

voodootikigod
Copy link
Contributor

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

@@ -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'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 added a commit that referenced this pull request Aug 22, 2011
Do not overwrite established content-type headers for read stream deliver
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants