Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters

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.

# 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
Rate this Question

Answers to this Question