usdot-fhwa-OPS / V2X-Hub

V2X Hub is a message handler that acts as a translator and data aggregator/disseminator for infrastructure components of a connected vehicle deployment.
Apache License 2.0
119 stars 67 forks source link

TIM Plugin POST requests bugs #172

Closed paulbourelly999 closed 3 years ago

paulbourelly999 commented 3 years ago

Types of Issue

Descriptive summary

Currently it seems the TIM Plugin will not send responses to successful POST requests causing processes that make these request to hang waiting on a response. Also exceptions caused by incorrectly formatted XML payloads are not caught, which may be causing the plugin to enter an unstable state after these exceptions are thrown.

V2XHUB version where this issue was discovered

5.0

Expected behavior

The TIM plugin should respond with the appropriate HTTP response codes based on the state of the request. With successful POST requests the appropriate response code is normally 201 (Created) and possibly 400 ( Bad Request) when XML exceptions are caught.

Actual behavior

Currently it seems the TIM Plugin will not send responses to successful POST requests causing processes that make these request to hang waiting on a response. Also exceptions caused by incorrectly formatted XML payloads are not caught, which may be causing the plugin to enter an unstable state after these exceptions are thrown.

Steps to reproduce the actual behavior

  1. Run V2XHub and enable the TIM Plugin.
  2. Install curl or any curl based REST API testing tool capable of sending custom http requests such as Postman.
  3. Create a POST request to the host and port set on the TIM configurations.
  4. Set the payload as a raw string of an example TIM Message. This can be found in the V2X_Hub_Plugins_Final documentation in the TIM section.
  5. Send the request. The request should get no response but in the logs for V2XHub you should see the curvedata printed. Ensure that you have a timupdate element in you XML if at first you don't see this in the logs
  6. Send another request with invalid or no XML payload. This should cause V2XHub to throw an bad tree exception which is uncaught in the logs. The TIM Plugin might no longer function as intended.

Related work

paulbourelly999 commented 3 years ago

Merged into develop