I have a question regarding DataMiner’s default behavior of automatically adding two headers, specifically, User-Agent: DataMiner/1.0 and Connection: Keep-Alive (Header element | DataMiner Docs). Is there a way to remove the User-Agent header, as it is causing my query to fail?
I used the Generic HTTP Query driver (https://docs.dataminer.services/connector/doc/Generic_HTTP_Query.html) for testing, and as you can see in the image below, the addition of the User-Agent header causes the HTTP request to fail. In the GetAccessTokenWithDataMiner request shown in the picture, the response body is empty, while the GetAccessToken request returns a response body containing the access token.
Is there any workaround or alternative solution to prevent DataMiner from sending the header that is causing issues in my use-case?
What have I tried?
1. I sent the same request as GetAccessTokenWithDataMinerHeader from the same machine via Bruno, and it didn't fail.
Request:
POST https://...
Content-Type: application/x-www-form-urlencoded
User-Agent: DataMiner/1.0
data "grant_type=client_credentials&client_id=myClientId&client_secret=myClientSecret"
Response:
< 200 OK
< server: nginx
< date: Fri, 21 Mar 2025 16:44:20 GMT
< content-type: application/json
< content-length: 941
< connection: keep-alive
< strict-transport-security: max-age=31536000; includeSubDomains
...
2. Testing via Command Prompt with cURL from the same machine, and it didn't fail:
Request:
curl -X POST "https://..." \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "User-Agent: DataMiner/1.0" \
-d "grant_type=client_credentials&client_id=myClientId&client_secret=myClientSecret"
Response:
{
"token_type": "Bearer",
"access_token": "...",
...
}
3. Overriding the Header in Generic HTTP Query:
I tried sending the same request as GetAccessTokenWithDataMinerHeader and overriding the User-Agent header with multiple different strings. This resulted in a 498 Generic Client Error. The Generic HTTP Query doesn't allow empty strings as value of the headers.
4. Overriding the Header with Empty Values:
I also attempted to override the header in the protocol with multiple values including empty strings, but this resulted in a 403 Forbidden response.
Note: In the captured Wireshark session of the driver I am working on (not the Generic HTTP Query Tool), the GetAccessToken query returned a status of 403 Forbidden, while the response body included the message:
"Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect."