servant-xml 1.0.2 → 1.0.3
raw patch · 3 files changed
+25/−10 lines, 3 files
Files
- CHANGELOG.md +6/−0
- servant-xml.cabal +15/−8
- src/Servant/XML.hs +4/−2
CHANGELOG.md view
@@ -1,5 +1,11 @@ # CHANGELOG +### 1.0.3 (2024-01-31)++#### Fixed++- Accept `Content-Type: application/xml` that are missing a `charset`. + ### 1.0.2 (2022-12-09) #### Changed
servant-xml.cabal view
@@ -1,15 +1,15 @@-cabal-version: 1.24+cabal-version: 2.2 name: servant-xml-version: 1.0.2+version: 1.0.3 synopsis: Servant support for the XML Content-Type description: Servant support for the Content-Type of /application\/xml/. Anything with 'ToXml' and 'FromXml' instances can be automatically marshalled. category: Web homepage: https://github.com/fosskers/servant-xml author: Colin Woodbury maintainer: colin@fosskers.ca-copyright: 2018 - 2019 Colin Woodbury-license: BSD3+copyright: 2018 - 2024 Colin Woodbury+license: BSD-3-Clause license-file: LICENSE build-type: Simple @@ -17,15 +17,22 @@ README.md CHANGELOG.md -library+common commons default-language: Haskell2010- hs-source-dirs: src- ghc-options: -Wall+ ghc-options:+ -Wall -Wcompat -Wincomplete-record-updates+ -Wincomplete-uni-patterns build-depends: base >= 4.7 && <5 , bytestring- , http-media >= 0.7++library+ import: commons+ hs-source-dirs: src+ build-depends:+ http-media >= 0.7 , servant >= 0.11 , xmlbf >= 0.7 , xmlbf-xeno >= 0.2.2 exposed-modules: Servant.XML+
src/Servant/XML.hs view
@@ -4,7 +4,7 @@ -- | -- Module : Servant.XML--- Copyright : (c) Colin Woodbury, 2018 - 2022+-- Copyright : (c) Colin Woodbury, 2018 - 2024 -- License : BSD3 -- Maintainer: Colin Woodbury <colin@fosskers.ca> --@@ -21,6 +21,7 @@ import Data.ByteString.Builder (toLazyByteString) import Data.ByteString.Lazy (toStrict)+import qualified Data.List.NonEmpty as NE import qualified Network.HTTP.Media as M import Servant.API import Xmlbf (FromXml(..), ToXml(..), encode, parse)@@ -43,7 +44,8 @@ data XML instance Accept XML where- contentType _ = "application" M.// "xml" M./: ("charset", "utf-8")+ contentTypes _ =+ "application" M.// "xml" M./: ("charset", "utf-8") NE.:| [ "application" M.// "xml" ] instance ToXml a => MimeRender XML a where mimeRender _ = toLazyByteString . encode . toXml