OK Here is my function - but it is not working because I get an error before it is called
val alterContentType: HttpResponse => HttpResponse = {r =>
val c = HttpHeaders.`Content-Type`(ContentType(`text/xml`))
r.withHeaders(r.headers.updated(r.headers.indexWhere(p =>
p.is("content-type")), c))
}
and my pipeline is
sendReceive ~> alterContentType ~> unmarshal
But I still get the following:
Illegal response header: Illegal 'Content-Type' header: Invalid input ';', expected TokenChar or '/' (line 1, pos 4):
19:58:13 local.1 | xml; charset=utf-8
and then
spray.httpx.PipelineException: UnsupportedContentType(Expected 'text/xml' or 'application/xml' or 'text/html' or 'application/xhtml+xml')