Problem
My current project requires me to do different things based on different HTTP request headers for nearly every action.
Currently, I have one massive Controller (all for the same resource type), and every action method has an ActionName attribute (so that I can have multiple versions of the same action that takes the same parameters, but does different things) and a custom FilterAttribute (implemented almost exactly like the AcceptVerbsAttribute in Preview 5) that checks if certain headers have certain values.
I would really like to push the code into separate Controllers, and have the RouteTable select between them based on the headers, but can't think of the cleanest way to do this.
Example
For example, say I have a list of files. The service must process the request in one of two ways:
The client wants a zip file, and passes "accept: application/zip" as a header, I take the list of files, pack them into a zip file, and send it back to the client.
The client wants an html page, so it passes "accept: text/html", the site sends back a table-formatted html page listing the files.