trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Provide support for request body in lua intercept plugin.

Open vmamidi opened this issue 3 years ago • 2 comments

Lua intercept plugins doesn't have ability to get request body.

vmamidi avatar Mar 21 '22 23:03 vmamidi

It is because we simply consume the data - https://github.com/apache/trafficserver/blob/master/plugins/lua/ts_lua_http_intercept.c#L284

Unlike in C++ Plugin, the data is consumed and parsed - https://github.com/apache/trafficserver/blob/master/src/tscpp/api/InterceptPlugin.cc#L197

To support this, we probably need to re-arrange the sequence of things that should happened. The body (and perhaps header) need to be offered to the handler function and thus we need to read and consume the data first before trigger the lua handler function. Right now the function is triggered right away.

shukitchan avatar Nov 10 '22 00:11 shukitchan

This issue has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.

github-actions[bot] avatar Nov 10 '23 01:11 github-actions[bot]