cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate Vary Header in response

Hello, My rest calls (using the c# rest API) have begun crashing because of a duplicate Vary header being returned from the test environment.  For example, a call to GetCustomerPaymentInstrumentsList or GetCustomer results in an exception because of the following headers in the response: 
HTTP/1.1 200
uniqueTransactionID: 48005e02-cd90-4c13-8631-e602fd8037fa
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Set-Cookie: JSESSIONID=xxxxxxA608xxxxDB6E4F9FE23FD490ED; Path=/; Secure; HttpOnly

The data in the response is correct, but those headers should be a single comma delimited value.

These Vary headers were not present in the same form a few days prior,

Was there a recent change to the test environment? (https://apitest.cybersource.com)

I suppose I can edit the client library to handle those additional Vary headers, but I think they may be incorrect.

Code fragment :  PostCustomerRequest result = apiInstance.GetCustomer(customerTokenId);

Result: Exception: "An item with the same key has already been added. Key: Vary'"

fdcyber
Member
5 REPLIES 5

The RetrieveCustomer Sample from cybersource-rest-samples-netcore also now fails with the same exception.

fdcyber
Member

I've only just started working with the Cybersource APIs and hit this problem immediately. I'm calling PostCustomerRequest() in the C# sample project and getting the error in PostCustomerWithHttpInfo() in the Cybersource SDK. I'm getting those same three 'vary' headers.

ahuey-shi-1
New Member

We are also running into this in the sandbox environment.  This currently breaks the C# REST SDK.

john_s_wu
Member

I am as well, got a note from support saying they have updated in sandbox to fix, but not seeing it fixed.  I will update my case there that it continues to return multiple vary headers and the C# client is using a dictionary to capture them. . .

jbruckart
Member

I see a fix pending in a branch on the client libraries.

fdcyber
Member