mod_compare serialized request format - Orange-OpenSource/mod_dup GitHub Wiki

This is done automatically by mod_dup with DupDuplicationType REQUEST_WITH_ANSWER.
In case you want to send data directly to mod_compare and you want a comparison to be properly performed,
the input request received by mod_compare must respect these constraints:

  • present the URL of original request, including query string, because no transformation is applied to it, it will arrive untouched to the API hosted alongside mod_compare.
  • must contain the following header: Duplication Type: Response
    • If this header is absent, the request will pass through untouched by mod_compare.
  • must contain the header X_DUP_METHOD if the original request is not a GET
  • body format must be: XXXXXXXX{request_body}XXXXXXXX{original_response_header}XXXXXXXX{original_response_body}
    • The body is deserialized,
    • if not empty, the request_body is sent to the next filter (to your API module in the end),
    • the original_response_header and body are kept in memory until your API responds, time at which the comparison can be performed.
    • The first 8 characters indicate the size of the request body. Then the request body, 8 characters for the size of the response header, the response header, 8 characters for the size of the response body and the response body.
Example of an HTTP request properly processed by mod_compare:
GET /service_name?REQUEST=getPage HTTP/1.1
Host: localhost:8080
Duplication-Type: Response
X_DUP_METHOD: POST
Content-Length: XXX

00000011RequestBody00000062UNIQUE_ID: 1784603073
Content-Type: text/xml; charset=UTF-8
00000020OriginalResponseBody
⚠️ **GitHub.com Fallback** ⚠️