|
14 | 14 | -- See the License for the specific language governing permissions and |
15 | 15 | -- limitations under the License. |
16 | 16 | -- |
17 | | - |
18 | 17 | local core = require("apisix.core") |
19 | 18 | local http = require("resty.http") |
20 | 19 | local log_util = require("apisix.utils.log-util") |
@@ -104,6 +103,8 @@ local schema = { |
104 | 103 | type = "array" |
105 | 104 | } |
106 | 105 | }, |
| 106 | + max_req_body_bytes = { type = "integer", minimum = 1, default = 524288 }, |
| 107 | + max_resp_body_bytes = { type = "integer", minimum = 1, default = 524288 }, |
107 | 108 | }, |
108 | 109 | encrypt_fields = {"auth.password"}, |
109 | 110 | oneOf = { |
@@ -214,6 +215,7 @@ local function get_logger_entry(conf, ctx) |
214 | 215 | core.json.encode(entry) .. "\n" |
215 | 216 | end |
216 | 217 |
|
| 218 | + |
217 | 219 | local function fetch_and_update_es_version(conf) |
218 | 220 | if conf._version then |
219 | 221 | return |
@@ -290,12 +292,16 @@ function _M.body_filter(conf, ctx) |
290 | 292 | log_util.collect_body(conf, ctx) |
291 | 293 | end |
292 | 294 |
|
293 | | -function _M.access(conf) |
| 295 | + |
| 296 | +function _M.access(conf, ctx) |
294 | 297 | -- fetch_and_update_es_version will call ES server only the first time |
295 | 298 | -- so this should not amount to considerable overhead |
296 | 299 | fetch_and_update_es_version(conf) |
| 300 | + |
| 301 | + log_util.check_and_read_req_body(conf, ctx) |
297 | 302 | end |
298 | 303 |
|
| 304 | + |
299 | 305 | function _M.log(conf, ctx) |
300 | 306 | local metadata = plugin.plugin_metadata(plugin_name) |
301 | 307 | local max_pending_entries = metadata and metadata.value and |
|
0 commit comments