Skip to content
Permalink
Browse files
call tostring on multipart.encode
  • Loading branch information
ignacio committed Sep 26, 2013
1 parent c46fe0b commit b5d0674
Showing 1 changed file with 2 additions and 2 deletions.
@@ -1,5 +1,5 @@
local pairs, table, tostring, select = pairs, table, tostring, select
local type, assert = type, assert
local type, assert, error = type, assert, error
local string = require "string"
local math = require "math"
local Url, Qs
@@ -91,7 +91,7 @@ local function encode(t, boundary)
}
append_data(r, k, v.data, extra)
else

This comment has been minimized.

Copy link
@ignacio

ignacio Sep 26, 2013

Author Owner

Don't call tostring on anything. Add a case for numbers and booleans. Return nil, error on functions and userdata.

See #11

error(string.format("unexpected type %s", _t))
append_data(r, k, tostring(v), {})
end
end
tprintf(r, "--%s--\r\n", boundary)

0 comments on commit b5d0674

Please sign in to comment.