View Issue Details

IDProjectCategoryView StatusLast Update
0035869FPCPackagespublic2019-08-26 08:48
ReporterSimon AmeisAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformDesktop PCOSWindows 7, 64 bitOS Version6.1 SP 1
Product VersionProduct Build 
Target VersionFixed in Version3.3.1 
Summary0035869: fcl-web: simpleserver mimetypes parameter and mime.types file
DescriptionOn Windows there is no default mime.types file. Thus all files are delivered as Application/octet-stream.
I suggest, the server should search in the current working directory for it or accept it as parameter.

Currently the parameter --mimetype is available but isn't included in CheckOptions() call.
This has to be changed to:
S:=Checkoptions('hqd:ni:p:sH:m:',['help','quiet','noindexpage','directory:','port:','indexpage:','ssl','hostname:','mimetypes:']);
Additional InformationThe server is used for pas2js integration in Lazarus. Thus it would also be valueable, if a mime.types file could be delivered with the program.
TagsNo tags attached.
Fixed in Revision42821
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Michael Van Canneyt

2019-08-26 08:48

administrator   ~0117839

The check for mimetypes had already been added in trunk.

I changed the mimetypes implementation, added a LoadKnownTypes. On unices this will load the known types from the system mime.types file.
On Windows this will load the known types from the registry, and if there is a mime.types files next to the binary, that will be loaded as well.
I have committed a default mime.types file next to the binary for the benefit of windows users.

Some additional minor fixes were done as well.

This new method is now called when the simpleserver starts. Additionally the -m parameter can still be specified to load additional types.

Issue History

Date Modified Username Field Change
2019-07-21 20:07 Simon Ameis New Issue
2019-07-21 22:37 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-07-21 22:37 Michael Van Canneyt Status new => assigned
2019-08-26 08:48 Michael Van Canneyt Status assigned => resolved
2019-08-26 08:48 Michael Van Canneyt Resolution open => fixed
2019-08-26 08:48 Michael Van Canneyt Fixed in Version => 3.3.1
2019-08-26 08:48 Michael Van Canneyt Fixed in Revision => 42821
2019-08-26 08:48 Michael Van Canneyt FPCTarget => 3.2.0
2019-08-26 08:48 Michael Van Canneyt Note Added: 0117839