diff --git a/proxy/http/HttpBodyFactory.cc b/proxy/http/HttpBodyFactory.cc index dade11953a8..2d88417268e 100644 --- a/proxy/http/HttpBodyFactory.cc +++ b/proxy/http/HttpBodyFactory.cc @@ -126,6 +126,10 @@ HttpBodyFactory::fabricate_with_old_api(const char *type, HttpTransact::State *c /////////////////////////////////////////// buffer = (format == nullptr) ? nullptr : ats_strndup(format, format_size); + if (buffer != nullptr && format_size > 0) { + *resulting_buffer_length = format_size > max_buffer_length ? 0 : format_size; + plain_flag = true; + } ///////////////////////////////////////////////////////// // try to fabricate the desired type of error response // /////////////////////////////////////////////////////////