Forum Discussion

bigben932_22424's avatar
bigben932_22424
Icon for Altostratus rankAltostratus
Dec 12, 2018

HTTP::header replace "Content-Type" not working

I have created an iRule to replace the Content-type header of a file. I am trying to replace a file with the mime type text/plain with text/css. However it seems that some header fields like Content-type cannot be changed by the iRule.

when HTTP_RESPONSE {
 Not working
    HTTP::header replace "Content-Type" "text/css"
 Working
    HTTP::header replace "Content-Type2" "text/css"
}

The response header shown by the browser looks like this:

Accept-Ranges: none
Connection: close
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' ws: wss: jar: data: blob: mediasource: mediastream:;
Content-Type: text/plain
Content-Type2: text/css
Date: Wed, 12 Dec 2018 18:37:00 GMT
ETag: "1d555-2d01-57cd0bd9120c0"
Last-Modified: Wed, 12 Dec 2018 10:34:19 GMT
Server: Apache
Transfer-Encoding: chunked
No RepliesBe the first to reply