refactor: plan media type

This commit is contained in:
steve-chavez
2023-06-17 23:00:32 -05:00
committed by Steve Chavez
parent 78821a8fe7
commit 3cd3a3f8c6
11 changed files with 157 additions and 100 deletions
+1
View File
@@ -16,4 +16,5 @@ main =
, "src/PostgREST/ApiRequest/Preferences.hs"
, "src/PostgREST/ApiRequest/QueryParams.hs"
, "src/PostgREST/Error.hs"
, "src/PostgREST/MediaType.hs"
]
+3 -2
View File
@@ -29,7 +29,8 @@ import PostgREST.Config (AppConfig (..),
LogLevel (..),
OpenAPIMode (..),
parseSecret)
import PostgREST.MediaType (MediaType (..))
import PostgREST.MediaType (MediaType (..),
NormalMedia (..))
import PostgREST.SchemaCache.Identifiers (QualifiedIdentifier (..))
import Protolude hiding (get, toS)
import Protolude.Conv (toS)
@@ -196,7 +197,7 @@ testCfgRootSpec :: AppConfig
testCfgRootSpec = baseCfg { configDbRootSpec = Just $ QualifiedIdentifier mempty "root"}
testCfgHtmlRawOutput :: AppConfig
testCfgHtmlRawOutput = baseCfg { configRawMediaTypes = [MTOther "text/html"] }
testCfgHtmlRawOutput = baseCfg { configRawMediaTypes = [MTNormal $ MTOther "text/html"] }
testCfgResponseHeaders :: AppConfig
testCfgResponseHeaders = baseCfg { configDbPreRequest = Just $ QualifiedIdentifier mempty "custom_headers" }