NancyFx/Nancy — pull request #1365 by jugglingnutcase (2013-12-10 21:38:59+00:00)
Title: Keep WCF from sending a `Content-Type` header with 304 Not Modified responses

## Problem

Nancy's WCF host sends a `Content-Type` header of `none/none` in its 304 Not Modified responses. According to [this mailing list post](https://groups.google.com/d/msg/python-tornado/-P_enYKAwrY/6VMsjtKBEzwJ) and its [reference to *section 10.3.5* of the HTTP specification](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5), this is not the way to do it.

## Fix

This patch adds a failing test and the fix to the failing test.

## Comments

From my examination, it looks like this code previously assumed that because something had to be sent to the WCF `CreateStreamResponse`'s `contentType`, it was impossible to prevent a `Content-Type` header from being sent. According to my included test and testing on a few reproduction projects, when a blank string is sent in this parameter, no `Content-Type` header gets sent in the response. If you want to see a reproduction, i can push it up to GitHub and link to it here.

In one of my code comments, i clear out the word "stupid" (in reference to WCF, in regards to this specific issue), please don't assume that means i don't agree with what it's saying :wink:

i searched for a while to see if this behavior is documented *anywhere* and i'm pretty sure it's not.

## Backstory

A customer of ours found this on their iOS 7 device in mobile safari. It looks like iOS 7 doesn't like: `Content-Type="none/none"` from 304s and will not apply styling from CSS files with this response and header.

This issue doesn't appear in older iOS versions. i'm wondering if it's related to issue `CVE-2013-5151` in [this security in iOS 7 kb](http://support.apple.com/kb/HT5934) from Apple. i find it a little poetic that this issue was reported by a GitHubber :thumbsup:.