From 84585b7a7e8f1ad1d89f1e5c0aa4f6e823316621 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Wed, 30 Jun 2021 13:21:01 +0200 Subject: Get rid of utf8-string Turns out that Char8.unpack is enough for our purposes, so we don't need the utf8-string module. --- Cana.cabal | 18 +++++++----------- package.yaml | 1 - src/Cana/Protocol.hs | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Cana.cabal b/Cana.cabal index c216625..d09fbf2 100644 --- a/Cana.cabal +++ b/Cana.cabal @@ -6,13 +6,12 @@ cabal-version: 1.12 name: Cana version: 0.1.0.0 -description: Please see the README on GitHub at -homepage: https://github.com/githubuser/Cana#readme -bug-reports: https://github.com/githubuser/Cana/issues -author: Author name here -maintainer: example@example.com -copyright: 2021 Author name here -license: BSD3 +description: Project Gemini server implementation, see the README for more details. +homepage: https://git.kingdread.de/cgit.cgi/Cana/about/ +author: Daniel Schadt +maintainer: Daniel Schadt +copyright: 2021 Daniel Schadt +license: BSD-3 license-file: LICENSE build-type: Simple extra-source-files: @@ -21,7 +20,7 @@ extra-source-files: source-repository head type: git - location: https://github.com/githubuser/Cana + location: https://git.kingdread.de/cgit.cgi/Cana flag static manual: True @@ -54,7 +53,6 @@ library , text , tls , transformers - , utf8-string , x509 , x509-store default-language: Haskell2010 @@ -80,7 +78,6 @@ executable Cana-exe , text , tls , transformers - , utf8-string , x509 , x509-store if flag(static) @@ -114,7 +111,6 @@ test-suite Cana-test , text , tls , transformers - , utf8-string , x509 , x509-store default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index ae262e1..6aa5a3c 100644 --- a/package.yaml +++ b/package.yaml @@ -35,7 +35,6 @@ dependencies: - text - process - stringsearch -- utf8-string library: source-dirs: src diff --git a/src/Cana/Protocol.hs b/src/Cana/Protocol.hs index 1a5f48e..be80f21 100644 --- a/src/Cana/Protocol.hs +++ b/src/Cana/Protocol.hs @@ -43,8 +43,8 @@ import Data.Char import Data.String import Text.Read import qualified Data.ByteString.Lazy as B +import qualified Data.ByteString.Lazy.Char8 as C import Data.ByteString.Lazy.Search -import qualified Data.ByteString.Lazy.UTF8 as UTF import Data.ByteString.Builder import Data.X509 (CertificateChain) import Network.URI @@ -222,7 +222,7 @@ parseResponse text = do header = fromMaybe header' $ B.stripSuffix headerDelim header' (code, meta') = B.break (== codeDelim) header meta = B.dropWhile (== codeDelim) meta' - statusCode <- readMaybe (UTF.toString code) >>= fromInt + statusCode <- readMaybe (C.unpack code) >>= fromInt return GeminiResponse { responseStatus = statusCode , responseMeta = meta -- cgit v1.2.3