diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/echo/echo.cpp | 8 | ||||
-rw-r--r-- | modules/modpy/modules/modpy.py | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/modules/echo/echo.cpp b/modules/echo/echo.cpp index a8496c5..4250802 100644 --- a/modules/echo/echo.cpp +++ b/modules/echo/echo.cpp @@ -32,8 +32,12 @@ namespace bitz { icap::payload_t payload; // copy payload from request - payload.req_header = request->payload().req_header; - payload.req_body = request->payload().req_body; + if ( request->header()->method() == "REQMOD" ) { + payload.req_header = request->payload().req_header; + payload.req_body = request->payload().req_body; + } + + // response body should only have content for RESPMOD requests payload.res_header = request->payload().res_header; payload.res_body = request->payload().res_body; diff --git a/modules/modpy/modules/modpy.py b/modules/modpy/modules/modpy.py index 874a615..1751cca 100644 --- a/modules/modpy/modules/modpy.py +++ b/modules/modpy/modules/modpy.py @@ -31,8 +31,13 @@ def modify( request ): # response resp_payload = {}; - resp_payload['req_header'] = req_payload['req_header']; - resp_payload['req_body'] = req_payload['req_body']; + if request['request'] == 'REQMOD': + resp_payload['req_header'] = req_payload['req_header']; + resp_payload['req_body'] = req_payload['req_body']; + else: + resp_payload['req_header'] = ''; + resp_payload['req_body'] = ''; + resp_payload['res_header'] = req_payload['res_header']; resp_payload['res_body'] = req_payload['res_body']; resp_payload['ieof'] = True; |