BingAds / BingAds-Java-SDK

Other
42 stars 47 forks source link

User-Agent header is causing requests to 400 #111

Closed keith-wiersema closed 4 years ago

keith-wiersema commented 5 years ago

The User-Agent header JAX-WS RI 2.1.5-hudson-$BUILD_NUMBER- is being set on every request and is causing a 400 invalid header response from Bing Ads. I suspect that the header value is not being escaped correctly. Right now, my work around is to remove this invalid header from the request.

qitia commented 5 years ago

@keith-wiersema which SDK version and java version are you using?

keith-wiersema commented 5 years ago

I am using java version 1.8.0_202 and BingAds Java SDK version 12.13.4.2. The header issue occurs with both v12 and v13 flows.

qitia commented 5 years ago

The normal user-agent looks like "User-Agent: BingAdsSDKJava 11.12.4 1.8.0_222": it compose "BingAdsSDKJava" plus this SDK version plus your java version.

What is your full user-agent content and what is your java version?

keith-wiersema commented 4 years ago

My full user-agent header looks like this: User-Agent: BingAdsSDKJava 12.13.4 12, JAX-WS RI 2.1.5-hudson-$BUILD_NUMBER- which is odd because the project should be running on java version "1.8.0_202".

qitia commented 4 years ago

Sorry for late reply. @keith-wiersema Yes it is odd since we are trying to retrieve the java version by System.getProperty("java.version"), suppose it should return the java version you are on. I will double check how this happen and provide fix in need.

BTW, could you please try update java version to see if it helps?

qitia commented 4 years ago

this should has been fixed since V13.0.2. @keith-wiersema, please reopen it if you still see this with latest version.

keith-wiersema commented 4 years ago

I just upgraded and this is fixed in 13.0.2, thank you @qitia !