diff options
| author | amelia squires <[email protected]> | 2024-09-29 02:49:05 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2024-09-29 02:49:05 -0500 |
| commit | e29d3ea86551380ace8e2c86c9f1f63e901941e1 (patch) | |
| tree | 526d2f71581e2584c9de2b958fd89b6ce0fb0ac1 /src/net/lua.c | |
| parent | 1feb3c40514a7c1726f29502ce37966c308bea79 (diff) | |
docs n stuff
Diffstat (limited to 'src/net/lua.c')
| -rw-r--r-- | src/net/lua.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/lua.c b/src/net/lua.c index dd73db2..df2213b 100644 --- a/src/net/lua.c +++ b/src/net/lua.c @@ -216,6 +216,14 @@ int l_sendfile(lua_State* L){ p_fatal("missing permissions"); } + char* ext = strrchr(path, '.'); + if(ext){ + char* content_type = map_get(mime_type, ext + 1); + + if(content_type) + {luaI_tsets(L, header, "Content-Type", content_type);} + } + str* r; i_write_header(L, header, &r, "", 0); send(client_fd, r->c, r->len, 0); |
