I would like to use an Azure function proxy to restrict access to an API by requiring that a specified request header X-MY-HEADER
is present. I don't want to actually check the value of the header here, just that it is present.
I can't find any examples of this and some trial and error hasn't worked. The proxy configuration is working properly before adding the additional for the header.
I have tried something like:
{
"proxies": {
"Mock API - POST": {
"matchCondition": {
"methods": [ "POST" ],
"route": "/api",
"request.headers.X-MY-HEADER": "{*}"
},
"responseOverrides": {
"response.headers.Location": "https://REAL/API/ADDRESS/ETC"
}
}
}
}
also "request.headers": "X-MY-HEADER"
but neither appear to work.
Is this possible to do and I just have the syntax wrong?
If the header is missing I'm happy for it to simply 404.