snap-server 1.0.3.3 → 1.1.0.0
raw patch · 2 files changed
+123/−107 lines, 2 filesdep +semigroupsdep ~HsOpenSSLdep ~attoparsecdep ~base
Dependencies added: semigroups
Dependency ranges changed: HsOpenSSL, attoparsec, base, blaze-builder, bytestring, bytestring-builder, case-insensitive, clock, containers, criterion, directory, filepath, io-streams-haproxy, lifted-base, mtl, network, old-locale, openssl-streams, snap-core, text, time, transformers, unix, unix-compat, vector
Files
- snap-server.cabal +89/−82
- src/Snap/Internal/Http/Server/Config.hs +34/−25
snap-server.cabal view
@@ -1,5 +1,5 @@ name: snap-server-version: 1.0.3.3+version: 1.1.0.0 synopsis: A web server for the Snap Framework description: Snap is a simple and fast web development framework and server written in@@ -18,8 +18,8 @@ build-type: Simple cabal-version: >= 1.10 homepage: http://snapframework.com/+bug-reports: https://github.com/snapframework/snap-server/issues category: Web, Snap, IO-Streams-tested-with: GHC==8.2.1, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2 extra-source-files:@@ -34,12 +34,12 @@ testserver/static/hello.txt tested-with:- GHC==7.4.2 GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.2,- GHC==8.2.1+ GHC==8.2.1,+ GHC==8.4.1 Flag portable Description: Compile in cross-platform mode. No platform-specific code or@@ -95,7 +95,7 @@ build-depends: attoparsec >= 0.12 && < 0.14,- base >= 4 && < 5,+ base >= 4.6 && < 4.12, blaze-builder >= 0.4 && < 0.5, bytestring >= 0.9.1 && < 0.11, bytestring-builder >= 0.10.4 && < 0.11,@@ -112,7 +112,7 @@ snap-core >= 1.0 && < 1.1, text >= 0.11 && < 1.3, time >= 1.0 && < 1.9,- unix-compat >= 0.2 && < 0.5,+ unix-compat >= 0.2 && < 0.6, vector >= 0.7 && < 0.13 other-extensions:@@ -129,6 +129,9 @@ EmptyDataDecls, GeneralizedNewtypeDeriving + if !impl(ghc >= 8.0)+ build-depends: semigroups >= 0.16 && < 0.19+ if flag(portable) || os(windows) cpp-options: -DPORTABLE else@@ -176,6 +179,7 @@ Default-language: Haskell2010 other-modules:+ Control.Concurrent.Extended, Paths_snap_server, Snap.Http.Server, Snap.Http.Server.Config,@@ -205,32 +209,32 @@ Test.Common.TestHandler build-depends:- attoparsec >= 0.12 && < 0.14,- base >= 4 && < 5,+ attoparsec,+ base, base16-bytestring >= 0.1 && < 0.2,- blaze-builder >= 0.4 && < 0.5,- bytestring-builder >= 0.10.4 && < 0.11,- bytestring >= 0.9.1 && < 0.11,- case-insensitive >= 1.1 && < 1.3,- clock >= 0.7.1 && < 0.8,- containers >= 0.3 && < 0.6,- directory >= 1.0 && < 1.4,- filepath >= 1.1 && < 2.0,+ blaze-builder,+ bytestring-builder,+ bytestring,+ case-insensitive,+ clock,+ containers,+ directory >= 1.1 && < 1.4,+ filepath, io-streams,- io-streams-haproxy >= 1.0 && < 1.1,- lifted-base >= 0.1 && < 0.3,+ io-streams-haproxy,+ lifted-base, monad-control >= 1.0 && < 1.1,- mtl >= 2.0 && < 2.3,- network >= 2.3 && < 2.7,- old-locale >= 1.0 && < 1.1,+ mtl,+ network,+ old-locale, random >= 1.0 && < 1.2,- snap-core >= 1.0 && < 1.1,- text >= 0.11 && < 1.3,+ snap-core,+ text, threads >= 0.5 && < 0.6,- time >= 1.0 && < 1.9,+ time, transformers >= 0.3 && < 0.6,- unix-compat >= 0.2 && < 0.5,- vector >= 0.7 && < 0.13,+ unix-compat,+ vector, HUnit >= 1.2 && < 2, QuickCheck >= 2.3.0.2 && < 3,@@ -256,18 +260,21 @@ EmptyDataDecls, GeneralizedNewtypeDeriving + if !impl(ghc >= 8.0)+ build-depends: semigroups+ if flag(portable) || os(windows) cpp-options: -DPORTABLE else- build-depends: unix < 2.8+ build-depends: unix -- always label threads in testsuite cpp-options: -DLABEL_THREADS if flag(openssl) cpp-options: -DOPENSSL- build-depends: HsOpenSSL >= 0.10.4 && < 0.12,- openssl-streams >= 1.1 && < 1.3+ build-depends: HsOpenSSL,+ openssl-streams if os(linux) && !flag(portable) cpp-options: -DLINUX -DHAS_SENDFILE -DHAS_UNIX_SOCKETS@@ -313,16 +320,16 @@ Snap.Internal.Http.Server.Parser build-depends:- attoparsec >= 0.12 && < 0.14,- base >= 4 && < 5,- blaze-builder >= 0.4 && < 0.5,- bytestring >= 0.9 && < 0.11,- bytestring-builder >= 0.10.4 && < 0.11,- criterion >= 0.6 && < 1.3,+ attoparsec,+ base,+ blaze-builder,+ bytestring,+ bytestring-builder,+ criterion >= 0.6 && < 1.5, io-streams,- io-streams-haproxy >= 1.0 && < 1.1,- snap-core >= 1.0 && < 1.1,- vector >= 0.7 && < 0.13+ io-streams-haproxy,+ snap-core,+ vector ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -fno-warn-unused-do-bind -rtsopts@@ -368,7 +375,7 @@ if flag(portable) || os(windows) cpp-options: -DPORTABLE else- build-depends: unix < 2.8+ build-depends: unix if os(linux) && !flag(portable) cpp-options: -DLINUX -DHAS_SENDFILE -DHAS_UNIX_SOCKETS@@ -392,29 +399,29 @@ if flag(openssl) cpp-options: -DOPENSSL- build-depends: HsOpenSSL >= 0.10.4 && < 0.12,- openssl-streams >= 1.1 && < 1.3+ build-depends: HsOpenSSL,+ openssl-streams build-depends:- attoparsec >= 0.12 && < 0.14,- base >= 4 && < 5,- blaze-builder >= 0.4 && < 0.5,- bytestring >= 0.9.1 && < 0.11,- bytestring-builder >= 0.10.4 && < 0.11,- case-insensitive >= 1.1 && < 1.3,- clock >= 0.7.1 && < 0.8,- containers >= 0.3 && < 0.6,+ attoparsec,+ base,+ blaze-builder,+ bytestring,+ bytestring-builder,+ case-insensitive,+ clock,+ containers, io-streams,- io-streams-haproxy >= 1.0 && < 1.1,- lifted-base >= 0.1 && < 0.3,- mtl >= 2.0 && < 2.3,- network >= 2.3 && < 2.7,- old-locale >= 1.0 && < 1.1,- snap-core >= 1.0 && < 1.1,- text >= 0.11 && < 1.3,- time >= 1.0 && < 1.9,- unix-compat >= 0.2 && < 0.5,- vector >= 0.7 && < 0.13+ io-streams-haproxy,+ lifted-base,+ mtl,+ network,+ old-locale,+ snap-core,+ text,+ time,+ unix-compat,+ vector ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -fno-warn-unused-do-bind -threaded -rtsopts@@ -443,8 +450,8 @@ if flag(openssl) cpp-options: -DOPENSSL- build-depends: HsOpenSSL >= 0.10.4 && < 0.12,- openssl-streams >= 1.1 && < 1.3+ build-depends: HsOpenSSL,+ openssl-streams default-language: Haskell2010 @@ -466,7 +473,7 @@ if flag(portable) || os(windows) cpp-options: -DPORTABLE else- build-depends: unix < 2.8+ build-depends: unix if os(linux) && !flag(portable) cpp-options: -DLINUX -DHAS_SENDFILE -DHAS_UNIX_SOCKETS@@ -489,27 +496,27 @@ System.SendFile.FreeBSD build-depends:- attoparsec >= 0.12 && < 0.14,- base >= 4 && < 5,- blaze-builder >= 0.4 && < 0.5,- bytestring >= 0.9.1 && < 0.11,- bytestring-builder >= 0.10.4 && < 0.11,- case-insensitive >= 1.1 && < 1.3,- clock >= 0.7.1 && < 0.8,- containers >= 0.3 && < 0.6,- directory >= 1.1 && < 1.4,+ attoparsec,+ base,+ blaze-builder,+ bytestring,+ bytestring-builder,+ case-insensitive,+ clock,+ containers,+ directory, io-streams,- io-streams-haproxy >= 1.0 && < 1.1,- lifted-base >= 0.1 && < 0.3,- mtl >= 2.0 && < 2.3,- network >= 2.3 && < 2.7,- old-locale >= 1.0 && < 1.1,- snap-core >= 1.0 && < 1.1,- text >= 0.11 && < 1.3,- time >= 1.0 && < 1.9,- transformers >= 0.3 && < 0.6,- unix-compat >= 0.2 && < 0.5,- vector >= 0.7 && < 0.13+ io-streams-haproxy,+ lifted-base,+ mtl,+ network,+ old-locale,+ snap-core,+ text,+ time,+ transformers,+ unix-compat,+ vector ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -fno-warn-unused-do-bind -threaded -rtsopts
src/Snap/Internal/Http/Server/Config.hs view
@@ -92,6 +92,9 @@ import Data.Monoid (Monoid (..)) #endif import Data.Monoid (Last (Last, getLast))+#if !MIN_VERSION_base(4,11,0)+import Data.Semigroup (Semigroup (..))+#endif import qualified Data.Text as T import qualified Data.Text.Encoding as T #if MIN_VERSION_base(4,7,0)@@ -286,31 +289,8 @@ -------------------------------------------------------------------------------instance Monoid (Config m a) where- mempty = Config- { hostname = Nothing- , accessLog = Nothing- , errorLog = Nothing- , locale = Nothing- , port = Nothing- , bind = Nothing- , sslport = Nothing- , sslbind = Nothing- , sslcert = Nothing- , sslchaincert = Nothing- , sslkey = Nothing- , unixsocket = Nothing- , unixaccessmode = Nothing- , compression = Nothing- , verbose = Nothing- , errorHandler = Nothing- , defaultTimeout = Nothing- , other = Nothing- , proxyType = Nothing- , startupHook = Nothing- }-- a `mappend` b = Config+instance Semigroup (Config m a) where+ a <> b = Config { hostname = ov hostname , accessLog = ov accessLog , errorLog = ov errorLog@@ -335,6 +315,35 @@ where ov :: (Config m a -> Maybe b) -> Maybe b ov f = getLast $! (mappend `on` (Last . f)) a b+++instance Monoid (Config m a) where+ mempty = Config+ { hostname = Nothing+ , accessLog = Nothing+ , errorLog = Nothing+ , locale = Nothing+ , port = Nothing+ , bind = Nothing+ , sslport = Nothing+ , sslbind = Nothing+ , sslcert = Nothing+ , sslchaincert = Nothing+ , sslkey = Nothing+ , unixsocket = Nothing+ , unixaccessmode = Nothing+ , compression = Nothing+ , verbose = Nothing+ , errorHandler = Nothing+ , defaultTimeout = Nothing+ , other = Nothing+ , proxyType = Nothing+ , startupHook = Nothing+ }++#if !MIN_VERSION_base(4,11,0)+ mappend = (<>)+#endif ------------------------------------------------------------------------------