aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_static_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2002-09-16 15:01:44 +0000
committerIgor Sysoev <igor@sysoev.ru>2002-09-16 15:01:44 +0000
commit682bf8e9c04fbe2fc9548985cdec173b6a9dcb27 (patch)
treeabca656ec5a3ca157b3fb37670285d49dd0800cc /src/http/modules/ngx_http_static_handler.c
parent1af7c82f7cde36d3813ee8f5dd45f8b03f5ad66c (diff)
downloadnginx-682bf8e9c04fbe2fc9548985cdec173b6a9dcb27.tar.gz
nginx-682bf8e9c04fbe2fc9548985cdec173b6a9dcb27.zip
nginx-0.0.1-2002-09-16-19:01:44 import
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
-rw-r--r--src/http/modules/ngx_http_static_handler.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index cbe430cf2..898e57757 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -65,7 +65,19 @@ int ngx_http_static_handler(ngx_http_request_t *r)
*/
/* STUB */
- r->headers_out->content_type = "text/html";
+ if (r->exten) {
+ if (strcasecmp(r->exten, "html") == 0)
+ r->headers_out->content_type = "text/html; charset=koi8-r";
+ else if (strcasecmp(r->exten, "gif") == 0)
+ r->headers_out->content_type = "image/gif";
+ else if (strcasecmp(r->exten, "jpg") == 0)
+ r->headers_out->content_type = "image/jpeg";
+ else if (strcasecmp(r->exten, "pdf") == 0)
+ r->headers_out->content_type = "application/pdf";
+
+ } else {
+ r->headers_out->content_type = "text/html; charset=koi8-r";
+ }
/* STUB */
rc = ngx_http_header_filter(r);