Closed ewf-devops closed 4 years ago
Original comment by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).
I propose a fix of assuming @RequestBody body
can be parsed to Map<String,Any>?
in CustomModulesController.customModuleMapping
@RestController
@RequestMapping("/ocpi/custom")
class CustomModulesController(private val requestHandlerBuilder: OcpiRequestHandlerBuilder) {
@RequestMapping("/{interfaceRole}/{module}", "/{interfaceRole}/{module}/**/*")
fun customModuleMapping(@RequestHeader("authorization") authorization: String,
@RequestHeader("OCN-Signature") signature: String? = null,
@RequestHeader("X-Request-ID") requestID: String,
@RequestHeader("X-Correlation-ID") correlationID: String,
@RequestHeader("OCPI-from-country-code") fromCountryCode: String,
@RequestHeader("OCPI-from-party-id") fromPartyID: String,
@RequestHeader("OCPI-to-country-code") toCountryCode: String,
@RequestHeader("OCPI-to-party-id") toPartyID: String,
@PathVariable interfaceRole: String,
@PathVariable module: String,
@RequestParam queryParams: Map<String, Any>,
@RequestBody body: String?,
request: HttpServletRequest): ResponseEntity<OcpiResponse<Any>>
Original comment by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).
@{557058:6d7b4493-acfb-4818-9eaf-956087983c24} or @{5efc3c2c54020e0ba82c6e64} , are you able to validate that this is a bug please?
Original comment by Adam Staveley (Bitbucket: [Adam Staveley](https://bitbucket.org/Adam Staveley), GitHub: adamstaveley).
Strange, I thought I tested POST requests. I will look into it later this week.
Original comment by Arzon Barua (Bitbucket: arzon.barua, ).
@{5efed1cdf34eae0ba6f4d21c} @{5efc3c2c54020e0ba82c6e64} I ran the integration test and also found error regarding the testMessagePost
Original comment by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).
PR with fix has been merged into Develop
Original report by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).
Version last reproduced:
1.1.0-rc1
Expected results: Can make a POST request via a custom OCPI module
Observed results:
When making a POST request via a custom module, and signing the request body, the following logs are received:
Repro steps:
Run integration test in this commit: https://bitbucket.org/shareandcharge/ocn-node/commits/54477d9246fca7a1c91171c606dc4504ed56f6fb?at=bug/custom-module-post