Skip to content

Commit 56e2b1d

Browse files
committed
Ensure strings returned in req:http_headers() are correct
1 parent bf933d0 commit 56e2b1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/lwan-lua.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ LWAN_LUA_METHOD(http_headers)
7373
break;
7474

7575
const char *value = key_end + 2;
76+
const char *value_end = helper->header_start[i + 1];
7677

7778
lua_pushlstring(L, key, (size_t)(key_end - key));
78-
lua_pushstring(L, value);
79+
lua_pushlstring(L, value, (size_t)(value_end - value - 2));
7980
lua_rawset(L, -3);
8081
}
8182

0 commit comments

Comments
 (0)