diff options
author | Daniel Schadt <kingdread@gmx.de> | 2021-06-30 13:21:01 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2021-06-30 13:21:01 +0200 |
commit | 84585b7a7e8f1ad1d89f1e5c0aa4f6e823316621 (patch) | |
tree | f23859b0977534ecd752ac4e63c21d0cf79a28a4 | |
parent | 8fe5dc12dc0c9fd63d5af4f49879dbf0d6f9eab3 (diff) | |
download | Cana-84585b7a7e8f1ad1d89f1e5c0aa4f6e823316621.tar.gz Cana-84585b7a7e8f1ad1d89f1e5c0aa4f6e823316621.tar.bz2 Cana-84585b7a7e8f1ad1d89f1e5c0aa4f6e823316621.zip |
Get rid of utf8-string
Turns out that Char8.unpack is enough for our purposes, so we don't need
the utf8-string module.
-rw-r--r-- | Cana.cabal | 18 | ||||
-rw-r--r-- | package.yaml | 1 | ||||
-rw-r--r-- | src/Cana/Protocol.hs | 4 |
3 files changed, 9 insertions, 14 deletions
@@ -6,13 +6,12 @@ cabal-version: 1.12 name: Cana version: 0.1.0.0 -description: Please see the README on GitHub at <https://github.com/githubuser/Cana#readme> -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 |