diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-17 18:18:44 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-17 18:18:44 +0000 |
commit | b468f0fc17590b77076802afd66e23cb78373943 (patch) | |
tree | 25d07d14e920d31c0b1947c9ca586f2a01fc32d8 /apps/netutils/webserver | |
parent | deb1733a09381470aef3eb62ad70a327f3380b69 (diff) | |
download | nuttx-b468f0fc17590b77076802afd66e23cb78373943.tar.gz nuttx-b468f0fc17590b77076802afd66e23cb78373943.tar.bz2 nuttx-b468f0fc17590b77076802afd66e23cb78373943.zip |
Resync new repository with old repo r5166
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5153 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/webserver')
-rw-r--r-- | apps/netutils/webserver/httpd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/netutils/webserver/httpd.c b/apps/netutils/webserver/httpd.c index 0c0ee0389..b482b1e03 100644 --- a/apps/netutils/webserver/httpd.c +++ b/apps/netutils/webserver/httpd.c @@ -100,6 +100,7 @@ static const char g_httpcontenttypehtml[] = "Content-type: text/html\r\n\r\n"; static const char g_httpcontenttypejpg[] = "Content-type: image/jpeg\r\n\r\n"; static const char g_httpcontenttypeplain[] = "Content-type: text/plain\r\n\r\n"; static const char g_httpcontenttypepng[] = "Content-type: image/png\r\n\r\n"; +static const char g_httpcontenttypejs[] = "Content-type: text/javascript\r\n\r\n"; #ifndef CONFIG_NETUTILS_HTTPD_SCRIPT_DISABLE static const char g_httpextensionshtml[] = ".shtml"; @@ -109,6 +110,7 @@ static const char g_httpextensioncss[] = ".css"; static const char g_httpextensionpng[] = ".png"; static const char g_httpextensiongif[] = ".gif"; static const char g_httpextensionjpg[] = ".jpg"; +static const char g_httpextensionjs[] = ".js"; static const char g_http404path[] = "/404.html"; #ifndef CONFIG_NETUTILS_HTTPD_SCRIPT_DISABLE @@ -391,6 +393,10 @@ static int send_headers(struct httpd_state *pstate, const char *statushdr, int l { ret = httpd_addchunk(pstate, g_httpcontenttypejpg, strlen(g_httpcontenttypejpg)); } + else if (strncmp(g_httpextensionjs, ptr, strlen(g_httpextensionjs)) == 0) + { + ret = httpd_addchunk(pstate, g_httpcontenttypejs, strlen(g_httpcontenttypejs)); + } else { ret = httpd_addchunk(pstate, g_httpcontenttypeplain, strlen(g_httpcontenttypeplain)); |