Commit 5d2ac4e0 authored by Sergey Lyubka's avatar Sergey Lyubka

Merge branch 'master' of ssh://github.com/valenok/mongoose

parents f977757a 1db13aee
...@@ -1994,7 +1994,7 @@ static void write_to_socket(struct connection *conn) { ...@@ -1994,7 +1994,7 @@ static void write_to_socket(struct connection *conn) {
} }
} }
const char *mg_get_mime_type(const char *path) { const char *mg_get_mime_type(const char *path, const char *default_mime_type) {
const char *ext; const char *ext;
size_t i, path_len; size_t i, path_len;
...@@ -2008,7 +2008,7 @@ const char *mg_get_mime_type(const char *path) { ...@@ -2008,7 +2008,7 @@ const char *mg_get_mime_type(const char *path) {
} }
} }
return "text/plain"; return default_mime_type;
} }
static struct uri_handler *find_uri_handler(struct mg_server *server, static struct uri_handler *find_uri_handler(struct mg_server *server,
...@@ -2094,7 +2094,7 @@ static void get_mime_type(const struct mg_server *server, const char *path, ...@@ -2094,7 +2094,7 @@ static void get_mime_type(const struct mg_server *server, const char *path,
} }
} }
vec->ptr = mg_get_mime_type(path); vec->ptr = mg_get_mime_type(path, "text/plain");
vec->len = strlen(vec->ptr); vec->len = strlen(vec->ptr);
} }
......
...@@ -87,7 +87,7 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...); ...@@ -87,7 +87,7 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...);
const char *mg_get_header(const struct mg_connection *, const char *name); const char *mg_get_header(const struct mg_connection *, const char *name);
const char *mg_get_mime_type(const char *file_name); const char *mg_get_mime_type(const char *file_name, const char *default_mime_type);
int mg_get_var(const struct mg_connection *conn, const char *var_name, int mg_get_var(const struct mg_connection *conn, const char *var_name,
char *buf, size_t buf_len); char *buf, size_t buf_len);
int mg_parse_header(const char *hdr, const char *var_name, char *buf, size_t); int mg_parse_header(const char *hdr, const char *var_name, char *buf, size_t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment