module Hack.Contrib.ContentType where

import Hack
import Hack.Utils
import Prelude hiding ((.), (^), (>))
import MPS

content_type :: String -> MiddleWare
content_type s app = \env -> do
  response <- app env
  
  case response.header "Content-Type" of
    Nothing -> response.set_header "Content-Type" s .return
    otherwise -> response .return