aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorame <[email protected]>2025-08-09 04:26:08 -0500
committerame <[email protected]>2025-08-09 04:26:08 -0500
commit71995aa7bab0198b3977f33d16ca34e4f628ec3d (patch)
treeac97473949ee4dcaa45ed2bcf1b8256f5180f70b /src/net
parent7cc8cade712506c7eeaf3a8e0002cf2313218885 (diff)
dont override Content-Type
Diffstat (limited to 'src/net')
-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)