Forum OpenACS Q&A: Re: limit size with util::http::get

Collapse
Posted by Gustaf Neumann on
Hi Jeff,

as a first shot, i've added the flag "-maxresponse" to ns_http to provide response size limit. Currently, it just compares the provided value with the received value of "Content‐Length" and raises an exception, when the size is exceeded. Adding cases where no content-length is provided, will follow.

% ns_http run -maxresponse 10KB https://orf.at
response limit exceeded

I am not fully happy with the name of the option. First i had "-responselimit", but i changed this to max*, since we have the max* convention in NaviServer also on many other places (e.g. maxinput, maxupload, ...). Naming these in 5.0 "uploadlimit" or "spoollimit" would be more self-explaining, we could make the old names deprecated, but i am not sure about the full consequences.