[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Content-Type in httpd_structs.h

From: Fabien Jambois
Subject: Re: [lwip-devel] Content-Type in httpd_structs.h
Date: Wed, 12 Apr 2017 15:09:39 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi Simon

Many Thanks for this information!

Actually, I'm using my own file system and I've enabled the following features:

#define HTTPD_USE_CUSTOM_FSDATA         1

Now, I'd like to support File caching with "Last-Modified: ..." and "Cache-Control: max-age=sec", in HTTP header of the response.

Also, I would like to automatically detect wether the file is compressed or not with gzip (by reading the file signature: 1F 8B 08) and then append the following line in header

    Content-Encoding: gzip

My idea is to have (for example) java-script files with extension .js and compress them with gzip (without modifying the file extension).

How can we do that without modifying the core of httpd code?

Is there any API for that purpose, I missed?

Or can we define a new one?

Thank you in advance for any suggestions or to guide me in these new wishes!

Kind regards


On 20.03.2017 22:21, address@hidden wrote:
Fabien Jambois wrote:
According to rfc7231, we have to change "Content-type" to "Content-Type" with upper-case T in httpd_structs.h

To my best knowledge, this is case insensitive (e.g., see RFC 7230, 3.2 "Header Fields": "Each header field consists of a case-insensitive field name followed by a colon [..]"). ALso, reading the mentioned RFC, I can't see why it would be case sensitive.
Nevertheless, since it's 'T' (not 't') in all the RFCs, I'm OK with changing it that way.

I've also added the content types you mentioned as well as a possibility to add custom content types at compile time (makefsdata compile time, for pre-filled headers).


lwip-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]