This works fine if the Content-Type header contains only type/sub-type without the optional ‘;parameter’. How can I modify the above test to check the header value for only the type/sub-type and ignore the optional parameter – without dropping out to java script?
Thanks - I am looking at the document. I thought ‘=|’ (starts with) would have worked equally if I could add ! to negate the operator. I am managing to get some bizarre errors when I do this – my API goes in a semi deployed state, reports of unknown errors, unable to undeploy/redeploy the proxy etc…
I would like to think the problems are unrelated and what I am doing is perfectly legitimate, although I am doubtful due to the consistency with which the errors happen. At one point, I did manage to add !~ (not Matches/Like), however the proxy performance suffered immensely. Again this may be coincidental and a result of general issues with the platform or it may be because of changes I have made. Hard to tell. I am slowly coming to the conclusion that this will be much simpler to do in a java script.
It would be disappointing to me, if you came to the conclusion that you needed Javascript to check a request header. But it would work just fine, also. If that’s what you want to do, by all means !
I can say only that it works for me. I use all of the above options, regularly , and never see a performance difference in any of them.
What kind of load are you running through the system, when you detect a performance difference?