initStatic :: C.Config -> IO Static
initStatic conf = do
  fillin <- mapM HC.parseRequest $ conf C.! "fillin"
  return $ Static
    { staticAuthorizeAddr = conf C.! "authorize"
    , staticAssistAddr = conf C.! "assist"
    , staticInvestigator = fmap (\f -> f
      { HC.method = methodPost
      , HC.requestHeaders = (hContentType, "application/x-www-form-urlencoded") : HC.requestHeaders f
      , HC.cookieJar = Nothing
      , HC.redirectCount = 0
      }) fillin
    , staticKey = hmac $ fromMaybe ("databrary" :: BS.ByteString) $ conf C.! "key"
    }
initStatic :: C.Config -> IO Static
initStatic conf = do
  fillin <- mapM HC.parseRequest $ conf C.! "fillin"
  return $ Static
    { staticAuthorizeAddr = conf C.! "authorize"
    , staticAssistAddr = conf C.! "assist"
    , staticInvestigator = fmap (\f -> f
      { HC.method = methodPost
      , HC.requestHeaders = (hContentType, "application/x-www-form-urlencoded") : HC.requestHeaders f
      , HC.cookieJar = Nothing
      , HC.redirectCount = 0
      }) fillin
    , staticKey = hmac $ fromMaybe ("databrary" :: BS.ByteString) $ conf C.! "key"
    }
initStatic conf = do
  fillin <- mapM HC.parseRequest $ conf C.! "fillin"
  return $ Static
    { staticAuthorizeAddr = conf C.! "authorize"
    , staticAssistAddr = conf C.! "assist"
    , staticInvestigator = fmap (\f -> f
      { HC.method = methodPost
      , HC.requestHeaders = (hContentType, "application/x-www-form-urlencoded") : HC.requestHeaders f
      , HC.cookieJar = Nothing
      , HC.redirectCount = 0
      }) fillin
    , staticKey = hmac $ fromMaybe ("databrary" :: BS.ByteString) $ conf C.! "key"
    }