07-Dec-2021
12:31
- last edited on
04-Jun-2023
19:15
by
JimmyPackets
How can I change content type for specific uri in http response ??
for example :
$ curl -I https://xxxxxx.com/.well-known/apple-app-site-association
HTTP/1.1 200 OK
Date: Mon, 06 Dec 2021 05:57:11 GMT
Content-Type: application/octet-stream
i want to set : Content-Type: application/json
in http response
Solved! Go to Solution.
08-Dec-2021
02:47
- last edited on
04-Jun-2023
19:14
by
JimmyPackets
Not sure how exactly this would help if response is not coming in json format from the server. but you can try below.
when HTTP_REQUEST {
set var_uri [HTTP::uri]
}
when HTTP_RESPONSE {
if { $var_uri eq "/.well-known/apple-app-site-association" } {
log local0. "match found $var_uri"
HTTP::header replace "Content-Type" "application/json"
return
}
}
08-Dec-2021
02:47
- last edited on
04-Jun-2023
19:14
by
JimmyPackets
Not sure how exactly this would help if response is not coming in json format from the server. but you can try below.
when HTTP_REQUEST {
set var_uri [HTTP::uri]
}
when HTTP_RESPONSE {
if { $var_uri eq "/.well-known/apple-app-site-association" } {
log local0. "match found $var_uri"
HTTP::header replace "Content-Type" "application/json"
return
}
}
08-Dec-2021 04:45
I'm really thankful for your useful reply. It completely solved my issue.
21-Mar-2022 07:16
Hi @SanjayP
Can you pls also help on this. I am also getting issue whie creating monitor with content-type.
I have raised: https://community.f5.com/t5/technical-forum/https-monitor-with-headers-content-type/m-p/293557
Can you pls support me here.