|
From: | Alexander Behrens |
Subject: | [lwip-devel] Missing SHTML support in makefsdata |
Date: | Thu, 23 Dec 2021 23:28:49 +0000 |
Dear all,
when translating shtml file using the Perl script lwip/src/apps/http/makefsdata/makefsdata the file later on got a wrong mimetype (text/plain).
It can be fixed by adding the file ending with the correct mimetype to makefsdata:
open(HEADER, "> /tmp/header") || die $!; if($file =~ /404/) { print(HEADER "HTTP/1.0 404 File not found\r\n"); } else { print(HEADER "HTTP/1.0 200 OK\r\n"); } print(HEADER "Server: lwIP/pre-0.6 (http://www.sics.se/~adam/lwip/)\r\n"); if($file =~ /\.html$/) { print(HEADER "Content-type: text/html\r\n"); } elsif($file =~ /\.shtml$/) { print(HEADER "Content-type: text/html shtml\r\n"); } elsif($file =~ /\.gif$/) { print(HEADER "Content-type: image/gif\r\n"); } elsif($file =~ /\.png$/) { print(HEADER "Content-type: image/png\r\n"); } elsif($file =~ /\.jpg$/) { print(HEADER "Content-type: image/jpeg\r\n"); } elsif($file =~ /\.class$/) { print(HEADER "Content-type: application/octet-stream\r\n"); } elsif($file =~ /\.ram$/) { print(HEADER "Content-type: audio/x-pn-realaudio\r\n"); } else { print(HEADER "Content-type: text/plain\r\n"); } print(HEADER "\r\n"); close(HEADER);
Kind regards and a merry Christmas,
Alex
[Prev in Thread] | Current Thread | [Next in Thread] |