From 8a553189b9fbbe56b4c873765118a770917c2c9f Mon Sep 17 00:00:00 2001 From: Paul Brinkmeier Date: Sun, 7 Apr 2024 19:45:16 +0200 Subject: [PATCH] Don't re-export `Network.Wai.Parse.ParseRequestBodyOptions` (#394) * Remove export of `ParseRequestBodyOptions` from `Web.Scotty` and `Web.Scotty.Trans` * Add changelog entry * Move changelog line to breaking changes --- Web/Scotty.hs | 6 +++--- Web/Scotty/Trans.hs | 2 +- changelog.md | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Web/Scotty.hs b/Web/Scotty.hs index bf22259..a58f5f8 100644 --- a/Web/Scotty.hs +++ b/Web/Scotty.hs @@ -32,7 +32,7 @@ module Web.Scotty , pathParamMaybe, captureParamMaybe, formParamMaybe, queryParamMaybe , pathParams, captureParams, formParams, queryParams -- *** Files - , files, filesOpts, Trans.ParseRequestBodyOptions + , files, filesOpts -- ** Modifying the Response and Redirecting , status, addHeader, setHeader, redirect -- ** Setting Response Body @@ -67,7 +67,7 @@ import Network.HTTP.Types (Status, StdMethod, ResponseHeaders) import Network.Socket (Socket) import Network.Wai (Application, Middleware, Request, StreamingBody) import Network.Wai.Handler.Warp (Port) -import qualified Network.Wai.Parse as W (defaultParseRequestBodyOptions) +import qualified Network.Wai.Parse as W import Web.Scotty.Internal.Types (ScottyT, ActionT, ErrorHandler, Param, RoutePattern, Options, defaultOptions, File, Kilobytes, ScottyState, defaultScottyState, ScottyException, StatusError(..), Content(..)) import UnliftIO.Exception (Handler(..), catch) @@ -242,7 +242,7 @@ files = Trans.files -- | Get list of temp files and form parameters decoded from multipart payloads. -- -- NB the temp files are deleted when the continuation exits -filesOpts :: Trans.ParseRequestBodyOptions +filesOpts :: W.ParseRequestBodyOptions -> ([Param] -> [File FilePath] -> ActionM a) -- ^ temp files validation, storage etc -> ActionM a filesOpts = Trans.filesOpts diff --git a/Web/Scotty/Trans.hs b/Web/Scotty/Trans.hs index 8096e7b..2320735 100644 --- a/Web/Scotty/Trans.hs +++ b/Web/Scotty/Trans.hs @@ -38,7 +38,7 @@ module Web.Scotty.Trans , pathParamMaybe, captureParamMaybe, formParamMaybe, queryParamMaybe , pathParams, captureParams, formParams, queryParams -- *** Files - , files, filesOpts, ParseRequestBodyOptions + , files, filesOpts -- ** Modifying the Response and Redirecting , status, Lazy.addHeader, Lazy.setHeader, Lazy.redirect -- ** Setting Response Body diff --git a/changelog.md b/changelog.md index 1d1bfa6..e944046 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,10 @@ ## next [????.??.??] + * Fixed cookie example from `Cookie` module documentation. `getCookie` Function would return strict variant of `Text`. Will convert it into lazy variant using `fromStrict`. ### Breaking changes * Remove dependency on data-default class (#386). We have been exporting constants for default config values since 0.20, and this dependency was simply unnecessary. +* Remove re-export of `Network.Wai.Parse.ParseRequestBodyOptions` from `Web.Scotty` and `Web.Scotty.Trans`. This is a type from `wai-extra` so exporting it is unnecessary.