MCPcopy
hub / github.com/probelabs/goreplay / httpBodyParam

Function httpBodyParam

middleware/middleware.js:352–361  ·  view source on GitHub ↗
(payload, name)

Source from the content-addressed store, hash-verified

350}
351
352function httpBodyParam(payload, name) {
353 let body = httpBody(payload);
354 let re = new RegExp(name + "=([^&$]+)");
355 if (body.indexOf(name + "=") != -1) {
356 let param = body.toString('utf-8').match(re);
357 if (param) {
358 return decodeURI(param[1]);
359 }
360 }
361}
362
363function setHttpBodyParam(payload, name, value) {
364 let body = httpBody(payload);

Callers 1

TEST_httpBodyParamFunction · 0.85

Calls 1

httpBodyFunction · 0.85

Tested by

no test coverage detected