Skip to content

change ab options -m to -p - #2

Closed
lonisy wants to merge 2 commits into
maxromanovsky:masterfrom
lonisy:master
Closed

lonisy wants to merge 2 commits into
maxromanovsky:masterfrom
lonisy:master

Conversation

@lonisy

@lonisy lonisy commented Jul 26, 2019

Copy link
Copy Markdown

change ab options -m to -p

postdata.push(name + "=" + value)
}
}
command += 'echo "'+postdata.join("&")+'" > form-data.txt' + "\n\n";

@maxromanovsky maxromanovsky Jul 26, 2019 •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It creates a temporary file on a filesystem, which is unexpected and should be avoided. Use mktemp if really necessary

var command = "# " + request.name + "\n";
var command = "# " + request.name + "\n\n";
var postdata = [];
if (request.method == "POST") {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other methods like PUT?

var command = "# " + request.name + "\n\n";
var postdata = [];
if (request.method == "POST") {
url_encoded_body = request.urlEncodedBody;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if body is not URL encoded, but a JSON, for instance?

}
command += "ab -c" + (self.options.concurrency || self.default_concurrency);
command += " -n" + (self.options.request_count || self.default_request_count);
command += " -m" + request.method;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be backward-compatible for other methods (GET)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants