diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/lua.c | 5 |
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) |
