appDomainName :: Handler Text
appDomainName = do
  app <- getYesod
  req <- waiRequest
  let domainStr = getApprootText guessApproot app req
      (pref, ds) = Text.breakOn "//" domainStr
      dsClean = if Text.length ds >= 2
                then Text.drop 2 ds
                else pref
  return . fst $ Text.breakOn "/" dsClean
appDomainName :: Handler Text
appDomainName = do
  app <- getYesod
  req <- waiRequest
  let domainStr = getApprootText guessApproot app req
      (pref, ds) = Text.breakOn "//" domainStr
      dsClean = if Text.length ds >= 2
                then Text.drop 2 ds
                else pref
  return . fst $ Text.breakOn "/" dsClean
appDomainName = do
  app <- getYesod
  req <- waiRequest
  let domainStr = getApprootText guessApproot app req
      (pref, ds) = Text.breakOn "//" domainStr
      dsClean = if Text.length ds >= 2
                then Text.drop 2 ds
                else pref
  return . fst $ Text.breakOn "/" dsClean