X XFediYour place in the Fediverse
XFEDI

Conversation

ActivityPub

Oct 21, 2026 · 20:36 UTC

Replies
↳ In reply to a post

Another very simple option in #Vinyl_Cache is to limit the size of request bodies using std.cache_req_body(). This also has the added benefit that chunked transfer encoding is tuned into a request with a content-length, such that php can check it upfront against the maximum body size.

In the example, the maximum size should be adjusted accordingly.

#php2shell

https://vinyl-cache.org/docs/trunk/reference/vmod_std.html#std-cache-req-body

sub vcl_recv {
	# Avoid OOM in php
	if (! std.cache_req_body(1M) &&
	    (req.http.Content-Length || req.http.Transfer-Encoding)) {
		return(synth(413));
	}
vinyl-cache.orgVMOD std - Vinyl Cache Standard Module - Vinyl Cache version trunk documentation
↩ Reply ♡ 0 · ↻ 0 ↗ Original