bunq / sdk_java

Java SDK for bunq API
MIT License
49 stars 24 forks source link

Custom headers don't override the default ones #141

Open panovitch opened 3 years ago

panovitch commented 3 years ago

Steps to reproduce:

  1. Pass a custom header to override the default one, e.g. client-request-id:
    Payment.create(
    new Amount("123", "EUR"),
    new Pointer("IBAN", "mockiban"),
    "description",
    123,
    null,
    null,
    false,
    Map(
      BunqHeader.CLIENT_REQUEST_ID.toString -> "123"
    ).toJava)

What should happen:

  1. The specified request header gets passed to the server, and the server recognises the Client Request ID.

What happens:

  1. The server doesnt recognise the passed client request ID, and doesnt deduplicate the requests. Upon further investigation, I found out that the new header value gets appended to the header key, instead of replacing it.

Traceback

SDK version and environment

Response id

Extra info: