-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Scenario:
local contentType = "multipart/form-data; boundary=--ff4ed67396bc8e1d6dbf19d65b6c6348";
local body = "--ff4ed67396bc8e1d6dbf19d65b6c6348\r\nContent-Disposition: form-data; name=\"contentType\"\r\n\r\nbody\r\n--ff4ed67396bc8e1d6dbf19d65b6c6348\r\nContent-Disposition: form-data; name=\"tmp\"\r\n\r\nContent file\r\n--ff4ed67396bc8e1d6dbf19d65b6c6348";
local headers = {
"content-type": contentType,
"content-length": body.len()
};
local app = Rocky();
app.on("GET", "/test", function(context) {
if ("table" != type(context.req.body)) {
server.log("Wrong type of context.req.body: " + type(context.req.body) + ", should be table");
}
context.send(200, {"message": "OK"});
}.bindenv(this));
imp.wakeup(0, function() {
local req = http.request("GET", http.agenturl() + "/test", headers, body);
req.sendasync(function(res){});
}.bindenv(this));Log:
[Agent] Wrong type of context.req.body: array, should be table
Tests:
This issue affects class: tests/CoreRockyMethod.nut method: testContentTypeMultipart()
Metadata
Metadata
Assignees
Labels
No labels