From 9a8d47bdcf50df2de261c16d62523fab67d3b076 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 22 Feb 2019 10:43:05 +0100 Subject: [PATCH] Always store file uploads in memory (no temporary files) --- src/Foundation.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Foundation.hs b/src/Foundation.hs index 7abccd7d0..629d8e84c 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -78,6 +78,8 @@ import qualified Crypto.Saltine.Core.SecretBox as SecretBox import qualified Database.Memcached.Binary.IO as Memcached import Data.Bits (Bits(zeroBits)) +import Network.Wai.Parse (lbsBackEnd) + instance DisplayAble b => DisplayAble (E.CryptoID a b) where display = display . ciphertext @@ -891,6 +893,8 @@ instance Yesod UniWorX where . runIdentity $ sourceList (Lazy.ByteString.toChunks content) $$ sinkHash + fileUpload _site _length = FileUploadMemory lbsBackEnd + -- What messages should be logged. The following includes all messages when -- in development, and warnings and errors in production. shouldLog _ _ _ = error "Must use shouldLogIO"