aboutsummaryrefslogtreecommitdiff
path: root/src/net/lua.c
diff options
context:
space:
mode:
authorame <[email protected]>2025-09-03 18:18:06 -0500
committerame <[email protected]>2025-09-03 18:18:06 -0500
commit1aba3757b486e28ddfb0aff67fe65e4a7a87c74f (patch)
treeb443750cc9899c6f7c265e357d5ef2605f5c95ac /src/net/lua.c
parenta239a832f14ed1f7eab9b9ee75867bdc2ee2a5f9 (diff)
parent6e6e948a553cc062b439f349c0b545df0223d9a1 (diff)
merge main
Diffstat (limited to 'src/net/lua.c')
-rw-r--r--src/net/lua.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net/lua.c b/src/net/lua.c
index d6bba65..2e46943 100644
--- a/src/net/lua.c
+++ b/src/net/lua.c
@@ -228,8 +228,11 @@ int l_sendfile(lua_State* L){
p_fatal("missing permissions");
}
+ lua_pushstring(L, "Content-Type");
+ lua_gettable(L, header);
+
char* ext = strrchr(path, '.');
- if(ext && mime_type != NULL){
+ if(lua_isnil(L, -1) && ext && mime_type != NULL){
char* content_type = map_get(mime_type, ext + 1);
if(content_type)