Intro to testing Ktor controllers
Let’s suppose that we want to dismiss all calls for api/restricted endpoint if they don’t have special header, in this case „X-Special-Header”. We access header via get PipelineContext and check if that value is null or blank. If so, we respond with HTTP 403. If given header is present, we proceed with some business logic …