lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] Missing SHTML support in makefsdata


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

--

 

Lilienthalstraße 2
15344 Strausberg
Germany

T: +49 (0) 3341 390 63-17
F: +49 (0) 3341 390 63-49
www.apus-aero.de

APUS Group:
APUS – Aeronautical Engineering GmbH, Commercial Register: Frankfurt/Oder HRB 15226FF, CEO: Phillip Scheffel
APUS – Aviation Engineering GmbH, Commercial Register: Frankfurt/Oder HRB 17061FF, CEO: Phillip Scheffel, COO: Jan Eichhorn
APUS – Flight Services GmbH, Commercial Register: Frankfurt/Oder HRB 17065FF, CEO: Phillip Scheffel, COO: Robert Adam

This e-mail contains confidential and/or legally protected information.
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.

reply via email to

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