diff --git a/src/Handler/Utils.hs b/src/Handler/Utils.hs index ed2334d5c..3f1bd2aae 100644 --- a/src/Handler/Utils.hs +++ b/src/Handler/Utils.hs @@ -54,8 +54,9 @@ serveOneFile query = do case results of [Entity _fileId File{fileTitle, fileContent}] | Just fileContent' <- fileContent -> do - whenM downloadFiles $ - addHeader "Content-Disposition" [st|attachment; filename="#{takeFileName fileTitle}"|] + ifM downloadFiles + (addHeader "Content-Disposition" [st|attachment; filename="#{takeFileName fileTitle}"|]) + (addHeader "Content-Disposition" [st|inline; filename="#{takeFileName fileTitle}"|]) return $ TypedContent (mimeLookup (pack fileTitle) <> "; charset=utf-8") (toContent fileContent') | otherwise -> sendResponseStatus noContent204 () [] -> notFound @@ -72,8 +73,9 @@ serveSomeFiles archiveName query = do [] -> notFound [Entity _fileId File{fileTitle, fileContent}] | Just fileContent' <- fileContent -> do - whenM downloadFiles $ - addHeader "Content-Disposition" [st|attachment; filename="#{takeFileName fileTitle}"|] + ifM downloadFiles + (addHeader "Content-Disposition" [st|attachment; filename="#{takeFileName fileTitle}"|]) + (addHeader "Content-Disposition" [st|inline; filename="#{takeFileName fileTitle}"|]) return $ TypedContent (mimeLookup (pack fileTitle) <> "; charset=utf-8") (toContent fileContent') | otherwise -> sendResponseStatus noContent204 () files -> do