Skip to content

Server.NotFound should negotiate content type #4

Description

@tekhedd

server's built-in NotFound handler supposedly will accept different payloads, but as used by the internal engine, it always returns ContentType.HTML with a "Not Found" body. It should be maybe a tiny bit more intelligent. (This would be a breaking change as most everybody will have overridden the NotFound handler for their apps.)

It should probably do something intelligent if the client accepts HTML or text only, but applications will need to override or add to this behavior to send JSON or XML not found messages (esp json for AngularJS). Add support for detecting very basic mime types:

  • JSON - send body with "data" and "message" in error, which is pretty standard
  • HTML - current behavior
  • default if nothing else supported - plain text "Not Found"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions