-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ocpi-2.2.1): Add Content-Type header on requests (if needed), on all responses & fixed headers case sensitivity #14
Conversation
…, & on all responses - HttpUtils - OcpiResponseBody
b523bcc
to
e32977a
Compare
It fixes debug headers not being sent in response if partner sends them in lowercase
e32977a
to
d2728dc
Compare
ocpi-toolkit-2.2.1/src/main/kotlin/com/izivia/ocpi/toolkit/common/HttpUtils.kt
Outdated
Show resolved
Hide resolved
I will also add an option to specify explicitely the It can be useful if the users have a traceId in the coroutine context and want to use it |
…ransportClient It is useful to give the user the control on the generated debug headers.
It is now possible to define how X-Request-ID and X-Correlation-ID are generated. Two methods were added to TransportClient interface. By default, the behaviour stays the same, it generates a random UUID. I also greatly improved Credentials tests by checking every request / response done during the process. This mecanisme can be reused in integration tests for anything else. |
Please retry analysis of this Pull-Request directly on SonarCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some feedbacks but that's beyond the scope of this PR. So I approve it like this, but I would like to discuss the approach used for the client and for the tokens before moving on further with more modules implementations.
Change notes
Only for ocpi 2.2.1
Content-Type: application/json
header is now added on requests if the body is not nullContent-Type: application/json
header is now added on all responsesX-Request-ID
andX-Correlation-ID
are properly propagated in responses even if the case does not match. Note:Authorization
header was working because it also acceptedauthorization
X-Request-ID
andX-Correlation-ID
are generated. You have to override methods in yourTransportClient
implementation. By default, the behaviour stays the same, it generates a randomUUID
.Migration guide
If you manually added Content-Type header & normalized headers in your Transport implementation, you can remove it.
Otherwise, you do not need to update anything. All the changes are included in the lib.
Notes
For versions 2.1.1 and 2.1.1 Gireve, two issues have been open: