The F# Saturn web framework fails on retrieving a value for GET method when acceptJson
is a part of pipeline.
Below a sample code that I run to reproduce the issue:
let api = pipeline {
plug acceptJson
set_header "x-pipeline-type" "Api"
}
let apiRouter = router {
not_found_handler (setStatusCode 404 >=> text "Api 404")
pipe_through api
get "/test" (text "Hello world")
}
let appRouter = router {
forward "/api" apiRouter
}
appRouter
is then added in the use_router
section of the application
code.
When I'm sending the request with a header Content-Type:application/json
the response is "404 not found". But if I remove plug acceptJson
from the api
pipeline definition I get a correct response.
How to make Saturn work with the plug acceptJson
?