Module: Rack
- Defined in:
- lib/rack/content_type_default.rb,
lib/rack/content_type_default/version.rb
Overview
This is a simple Rack Middleware to set the request content type for specific routes. It checks if a content type is set and does not override the existing one. The options allow you to specify the request methods and the content type to be set. The options also allow you to set a default content type only on select paths. In addition, the options allow you to set content type to to application/json or application/xml if possible based on the path ending. Copied and adapted from gist.github.com/tstachl/6264249
Defined Under Namespace
Classes: ContentTypeDefault