GetHTTPRequestData(): uses memory reading request body every time it is called

Description

Every time GetHTTPRequestData() is called (without setting includeBody=false), the request body is read into memory.

If you upload a large file, for example, and happen to call getHttpRequestData() in lots of places, this causes an additional and considerable burden on the request memory footprint.

Suggestion: if possible, only parse the body the first time it is requested. Subsequent calls can then just refer to this by reference.

Activity

Show:
Brad Wood
December 8, 2020, 7:07 PM

I'm confused by this as the Java servlet spec already only allows the request body to be read once:
https://docs.oracle.com/javaee/7/api/javax/servlet/ServletRequest.html#getInputStream--
Lucee employs a servlet request wrapper that reads the request body once and caches it. What exactly are you seeing that is bring "read" more than once?

Assignee

Unassigned

Reporter

Dominic Watson

Labels

Priority

New