HTTPD: how are Content-Type and Content-Encoding HTTP headers set ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

HTTPD: how are Content-Type and Content-Encoding HTTP headers set ?

跳至解决方案
1,110 次查看
alexandrevincon
Contributor III

I am currently studying the "httpsrv" example project from MQX 4.0 and I would like to know how the HTTPD server determines the value of Content-Type in the HTTP reply's header ? Is it deduced from the extension of the file, ie ".html" files automatically lead to "text/html" and ".js" files to "application/javascript" ?

Also, I would like to try and gzip the pages to gain some space. Is the Content-Encoding header set to "gzip" in this case ?

Many thanks to anyone who can answer !

Best regards,

AV

0 项奖励
回复
1 解答
892 次查看
Martin_
NXP Employee
NXP Employee

Hi AV,

c:\Freescale\Freescale_MQX_4_0\rtcs\source\httpd\httpd_supp.c

function httpd_sendfile()

Contenttype is based on the file extension.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
893 次查看
Martin_
NXP Employee
NXP Employee

Hi AV,

c:\Freescale\Freescale_MQX_4_0\rtcs\source\httpd\httpd_supp.c

function httpd_sendfile()

Contenttype is based on the file extension.

0 项奖励
回复
892 次查看
alexandrevincon
Contributor III

Thanks a lot !

0 项奖励
回复