Sam
05/06/2024, 6:08 AMResponseHeaders
in the ApplicationResponse
?
I've multiple mircoservices which all use some plugins like DefaultHeaders, CORS and HSTS. All of these plugins sets some HTTP headers to the application / root route. This stuff is outsourced to some kind of base module in a separate library which is used by all my services.
Now I have a single route in a single mircoservice where I don't want to have alle theses default headers. But I've found no way to remove them.
I have found this older workaorund here: [Question] Override/Add Headers to response to ktor client. But that doesn't seem to work anymore with Ktor 2 cause you now have the PipelineContext
as receiver with the contained ApplicationCall
, from which the headers can not be removed.Aleksei Tirman [JB]
05/07/2024, 9:21 AMSam Ordonez
05/09/2024, 3:05 AMSam Ordonez
05/09/2024, 3:07 AM