Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Response.ContentType doesn't work in MVC controller #2947

@Eilon

Description

@Eilon

From @Daniel15 in aspnet/HttpAbstractions#364:

I'm using Razor to generate some XML (an RSS feed). I have this in one of my ASP.NET MVC controllers:

Response.ContentType = "application/rss+xml";
return View("Foo")

However IIS Express is still serving the response as text/html.

This doesn't work either:

Response.Headers.Set("Content-Type", "application/rss+xml");

However, setting a custom header (eg. X-Test) does work.

(I wasn't sure whether to report this here or in the ASP.NET MVC repo)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions