Skip to content

Commit

Permalink
Fixed request handles munging line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 authored Aug 9, 2024
1 parent 0a7503c commit b6c665d
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/apis/handles/http_handle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ int req_readLine(lua_State *L) {
if (*(bool*)lua_touserdata(L, lua_upvalueindex(2)) || !req->stream().good()) return luaL_error(L, "attempt to use a closed file");
std::string line;
std::getline(req->stream(), line);
line.erase(std::remove(line.begin(), line.end(), '\r'), line.end());
lua_pushstring(L, line.c_str());
return 1;
}
Expand All @@ -228,7 +227,6 @@ int req_readAll(lua_State *L) {
while (req->stream().read(buffer, sizeof(buffer)))
ret.append(buffer, sizeof(buffer));
ret.append(buffer, req->stream().gcount());
ret.erase(std::remove(ret.begin(), ret.end(), '\r'), ret.end());
lua_pushstring(L, ret.c_str());
return 1;
}
Expand Down

0 comments on commit b6c665d

Please sign in to comment.