I'm developing a local-only PHP application (https://github.com/decision-making-mike/lms). It uses URLs to transfer data between its states. Accordingly, I wanted to check how much data can be transferred.
Now, I know browsers can have their own limits, so that's another story. In this question I'm focusing on the server. I'm using Apache HTTP Server 2.4.41. With trial and error, I was able to determine that when I do this (in Bash): curl -I "http://localhost?$( head -c 8175 /dev/zero | tr '\0' a )" I get this: HTTP/1.1 200 OK and when I do this: curl -I "http://localhost?$( head -c 8176 /dev/zero | tr '\0' a )" (one byte more) I get this: HTTP/1.1 414 Request-URI Too Long Initially I didn't know what "Request-URI" is. I determined it examining - RFC 2616's definition of it (https://datatracker.ietf.org/doc/html/rfc2616#section-5.1.2), - Apache's documentation of the LimitRequestLine Directive (https://httpd.apache.org/docs/current/mod/core.html#limitrequestline), - my logs, - and Apache's Common Log Format (https://httpd.apache.org/docs/current/logs.html#common). During the examination, I got to know that there's the thing "request line" ("Request-Line"?), and that Apache limits it to 8190 bytes by default. Then: 1. I checked that the last log entry is relevant to the "curl..." command with the shorter payload (by checking status code, date, time), 2. I did tail -n1 /var/log/apache2/access.log | gawk -F\" '{ printf "%s", $2; }' | wc -c 3. and I got this: 8191 This number means the limit of my request line. We see there's 1 byte of difference compared to the number given by the documentation of the server (8190). There is no LimitRequestLine directive in either /etc/apache2/apache2.conf or /etc/apache2/sites-available/000-default.conf. Why the difference? Am I missing something? If one knows a way to confirm that with one simple command, please let me know. E.g. I'm not sure if curl can return just the request line, without any newlines and the like prepended or appended. I've posted this question to StackExchange, and got one cofirmation that the actual limit is 8191: https://superuser.com/questions/1939164/why-does-my-request-line-limit-in-apache-seem-not-to-equal-the-default-limit#comment3034504_1939164 Mike --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
