Empty string was printed after tostring() call
- Dominant language
- Lua
- Stars
- 56
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
[example.txt](https://github.com/Kong/lua-multipart/files/9418657/example.txt)
Hi!
My file example.txt is attached.
```lua
local Multipart = require("multipart")
local io = require("io")
local open = io.open
local function read_file(path)
local file = open(path, "r")
if not file then return nil end
local content = file:read "*a"
file:close()
return content
end
local body = read_file("example.txt");
local multipart_data = Multipart(body, "text/html")
local t = multipart_data:tostring()
print (t)
```
This code prints empty line. What's wrong? Please, explain it.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the report using the attached example.txt and the Lua snippet, starting at the Multipart(body, "text/html") call and the tostring() entry point. Trace how the input is parsed and determine why print(t) produces an empty line; done means the cause and expected usage are clearly explained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100