fix: api 500 error (#13)

This commit is contained in:
soandsoso 2020-02-14 23:28:22 +08:00 committed by GitHub
parent 5481e0a7c2
commit 9f5b768ef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,13 +181,18 @@ function Encoder.parse_iter(self, obj)
end
end
function Encoder.parse_udata(self, obj)
return self:parse_string(tostring(obj))
end
Encoder.parsers = {
['nil'] = Encoder.parse_nil,
['table'] = Encoder.parse_iter,
['number'] = Encoder.parse_number,
['string'] = Encoder.parse_string,
['boolean'] = Encoder.parse_bool,
['function'] = Encoder.parse_iter
['function'] = Encoder.parse_iter,
['userdata'] = Encoder.parse_udata,
}