tokensmith / otter

micro web framework for servlet api 4.0.1
MIT License
5 stars 0 forks source link

Handle Dispatch Errors #113

Closed tmackenzie closed 5 years ago

tmackenzie commented 5 years ago

Dispatch Errors that occur in engine

Given a request with the header Content-Type: application/json When the url is matched and it expects Content-Type: application/json; charset=utf-8 Then add the header X-Reasons which is a unsecure jwt with the payload

[
  {
    "k": "Content-Type",
    "v": "application/json",
    "src": "hdr", 
    "exp": ["application/json; charset=utf-8"], 
    "msg": ""
  },
]

And set the status code to 415 And dispatch the request to a configured Unsupported Media Type Route.