Using ServiceStack, I just want to return 304 Not Modified as such:
HTTP/1.1 304 Not Modified
But ServiceStack adds many other unwanted (returning HttpResult with 304 code) headers per se:
HTTP/1.1 304 Not Modified Content-Length: 0 Content-Type: application/json Server: Microsoft-HTTPAPI/2.0 X-Powered-By: ServiceStack/3.94 Win32NT/.NET Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS Access-Control-Allow-Headers: Content-Type Date: Tue, 07 Aug 2012 13:39:19 GMT
How can I prevent the output of other headers? I tried various approaches with HttpResult , registering a filter like fictitious content, but since its name implies only control over the content, not the headers, or others listed here . I also tried to implement my own derived IHttpResult using IStreamWriter and IHasOptions with the same results: ServiceStack adds unwanted headers.
thanks
Update
I managed to remove the content-type using the following, but some headers are still present, i.e. content-length , server and date .
public override object OnGet(FaultTypes request) { var result = new HttpResult { StatusCode = HttpStatusCode.NotModified, StatusDescription = "Not Modified",
source share