Fixes #381
This commit is contained in:
parent
86204f78e2
commit
601cbeab76
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user