diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 317c760..46289b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: experimental: false steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install GHC and Cabal uses: haskell-actions/setup@v2 with: diff --git a/Changelog.md b/Changelog.md index 0fdc364..db5c0ae 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +### 1.2.7 + +- Support package *base64* *1.0*. + ### 1.2.6 - Refactored to avoid using *head* and *tail* as it triggers *x-partial* diff --git a/LICENSE b/LICENSE index 0dbcd5d..8553cb2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ The following license covers this documentation, and the source code, except where otherwise indicated. -Copyright 2019-2023, Alexey Radkov. All rights reserved. +Copyright 2019-2024, Alexey Radkov. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/NgxExport/Tools/EDE.hs b/NgxExport/Tools/EDE.hs index 8496f88..3592d81 100644 --- a/NgxExport/Tools/EDE.hs +++ b/NgxExport/Tools/EDE.hs @@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | -- Module : NgxExport.Tools.EDE --- Copyright : (c) Alexey Radkov 2020-2023 +-- Copyright : (c) Alexey Radkov 2020-2024 -- License : BSD-style -- -- Maintainer : alexey.radkov@gmail.com @@ -47,6 +47,9 @@ import qualified Data.ByteString.Char8 as C8 import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy.Char8 as C8L import Data.ByteString.Base64.URL +#if MIN_VERSION_base64(1,0,0) +import Data.Base64.Types +#endif import Data.IORef import Data.Text (Text) import qualified Data.Text.Encoding as T @@ -242,12 +245,17 @@ ngxExportSimpleServiceTyped 'compileEDETemplates ''InputTemplates -- * __/uenc/__ encodes a 'Value' using /URL encoding/ rules. extraEDEFilters :: HashMap Id Term extraEDEFilters = HM.fromList - ["b64" @: applyToValue encodeBase64 + ["b64" @: applyToValue eb64 ,"uenc" @: applyToValue (T.decodeUtf8 . urlEncode False) ] where applyToValue :: (ByteString -> Text) -> Value -> Text applyToValue f (String t) = f $ T.encodeUtf8 t applyToValue f v = f $ L.toStrict $ encode v +#if MIN_VERSION_base64(1,0,0) + eb64 = extractBase64 . encodeBase64 +#else + eb64 = encodeBase64 +#endif -- | Renders an EDE template from a JSON object. -- diff --git a/ngx-export-tools-extra.cabal b/ngx-export-tools-extra.cabal index cba4d2a..1d6d991 100644 --- a/ngx-export-tools-extra.cabal +++ b/ngx-export-tools-extra.cabal @@ -1,8 +1,8 @@ name: ngx-export-tools-extra -version: 1.2.6 -synopsis: More extra tools for Nginx haskell module +version: 1.2.7 +synopsis: More extra tools for Nginx Haskell module description: More extra tools for - . + . homepage: https://github.com/lyokha/ngx-export-tools-extra license: BSD3 license-file: LICENSE @@ -10,7 +10,7 @@ extra-doc-files: Changelog.md author: Alexey Radkov maintainer: Alexey Radkov stability: stable -copyright: 2019-2023 Alexey Radkov +copyright: 2019-2024 Alexey Radkov category: Network build-type: Simple cabal-version: 1.20