Skip to content

Commit

Permalink
Ensure strings returned in req:http_headers() are correct
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed Jun 1, 2024
1 parent bf933d0 commit 56e2b1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/lwan-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ LWAN_LUA_METHOD(http_headers)
break;

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

lua_pushlstring(L, key, (size_t)(key_end - key));
lua_pushstring(L, value);
lua_pushlstring(L, value, (size_t)(value_end - value - 2));
lua_rawset(L, -3);
}

Expand Down

0 comments on commit 56e2b1d

Please sign in to comment.