I have a server that accepts HTTP POSTs from an 3rd Party, then returns either a 200 or 500.
The 3rd Party is not under my control, and sometimes sends very large POSTs, e.g. 40MB.
These POSTs cause my PHP code to run out of memory, which I can't catch, and so apache sends a 500.
The API retries that POST forever, and doesn't send new data, so this is a problem.
I've tried various things, but have ended up thinking that if I could have .htaccess just return a 200 and do nothing else, if the content_length was > X, then this would at least buy me time to restructure how this works.
So…
Is it possible to write a rule in .htaccess such that if content_length > X, it returns a 200?