Ed
04/29/2025, 7:57 AMjava -jar .\wiremock-standalone-3.13.0.jar --print-all-network-traffic
I have a json file in the mappings directory that configure the proxy and should remove Authorization header:
{
"request": {
"method": "POST",
"url": "/notification"
},
"response": {
"proxyBaseUrl": "<http://localhost:8081>",
"removeProxyRequestHeaders": [
"Authorization"
]
}
}
but at the end, the Authorization header is still sent to the final server
did I miss anything?Lee Turner
04/29/2025, 8:21 AMEd
04/29/2025, 8:26 AMEd
04/29/2025, 8:30 AMpublic ProxyResponseDefinitionBuilder withRemoveRequestHeader(String key) {
removeRequestHeaders.add(key.toLowerCase());
return this;
}
Ed
04/29/2025, 8:30 AM{
"request": {
"method": "POST",
"url": "/notification"
},
"response": {
"proxyBaseUrl": "<http://localhost:8081>",
"removeProxyRequestHeaders": [
"authorization"
]
}
}
And it works!!!Ed
04/29/2025, 8:31 AMLee Turner
04/29/2025, 8:31 AMLee Turner
04/29/2025, 8:33 AMremoveProxyRequestHeaders
so users can add whatever case they wantEd
04/29/2025, 9:09 AM