Skip to content

Commit

Permalink
feat: gzip: support "application/json"
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
  • Loading branch information
zhaojh329 committed Nov 10, 2021
1 parent ef0fc98 commit 5abf120
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ static void file_if_gzip(struct uh_connection *conn, const char *path, const cha
if (!hdr.p || !memmem(hdr.p, hdr.len, "gzip", 4))
return;

if (strcmp(mime, "text/css") && strcmp(mime, "text/javascript") && strcmp(mime, "text/html"))
if (strcmp(mime, "text/css") && strcmp(mime, "text/javascript") && strcmp(mime, "text/html") &&
strcmp(mime, "application/json"))
return;

fd = open(path, O_RDONLY);
Expand Down

0 comments on commit 5abf120

Please sign in to comment.