You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using an API where part of its functionality depends on the User-Agent. To make it work with WireMock proxy I need to rewrite the User-Agent header using additionalProxyRequestHeaders, for example:
"response" : { "proxyBaseUrl": "https://one.api.com", "additionalProxyRequestHeaders": { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_2 like Mac OS X)" } }
This stopped working after version 3.2.0.
Reproduction steps
With WireMock >= 3.3.0
Route a request through WireMock proxy
Rewrite the User-Agent header with additionalProxyRequestHeaders
Expected result:
The host is sent the header defined in additionalProxyRequestHeaders
Actual result:
The host is sent the default WireMock user agent
Can you try remove-headers to clear the existing value (I believe this requires 3.5+):
{
"proxyBaseUrl": "https://one.api.com",
"removeProxyRequestHeaders": [
"User-Agent"
],
"additionalProxyRequestHeaders": {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_2 like Mac OS X)"
}
}
Proposal
I'm using an API where part of its functionality depends on the User-Agent. To make it work with WireMock proxy I need to rewrite the User-Agent header using
additionalProxyRequestHeaders
, for example:"response" : { "proxyBaseUrl": "https://one.api.com", "additionalProxyRequestHeaders": { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_2 like Mac OS X)" } }
This stopped working after version 3.2.0.
Reproduction steps
additionalProxyRequestHeaders
Expected result:
The host is sent the header defined in
additionalProxyRequestHeaders
Actual result:
The host is sent the default WireMock user agent
References
https://wiremock.org/docs/proxying/#additional-headers
The text was updated successfully, but these errors were encountered: