Re: Lua r:requestbody() removes HTTP request body

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 2022-11-29 15:56, Eric Covener escribió:
On Tue, Nov 29, 2022 at 10:45 AM bruno.mendoza <bruno.mendoza@xxxxxxxxxx> wrote:


Hi,

I trying to read every HTTP request message body (Apache httpd
2.4.5/Debian 9.5) where content type is equal to 'text/xml'. For this
purpose I use a Lua handler script during the request translation phase
using the directive 'LuaHookTranslateName'
(https://publib.boulder.ibm.com/httpserv/manual24/mod/mod_lua.html#luahooktranslatename).

This Lua handler script uses the function 'r:requestbody()' defined in
the reference manual section 'Built in function'
(https://publib.boulder.ibm.com/httpserv/manual24/mod/mod_lua.html#functions).
This method reads and returns the body of the HTTP request but it also
REMOVES the body of the request.

Is this bug reported?

Give https://httpd.apache.org/docs/current/mod/mod_request.html a try,
it is a way to opt-in to buffering the request body so it can be read
multiple times.


Hi Eric,

I tried:

""
<VirtualHost *:80>

[...]

<LocationMatch "^/<affected_url_segment>">
    KeptBodySize 10240
</LocationMatch>

LuaHookTranslateName "/some/location/script.lua" handle

[...]

</VirtualHost>
""

But the result is the same. After calling mod_lua 'r:requestbody()' function the request body is removed.

I'm "proxying" HTTP requests to another HTTP service.

Does exist another way of using "mod_request"?

Thanks for your answers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux