File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -381,13 +381,20 @@ impl FileServer {
381381
382382 /// Return the media type of the file based on the path.
383383 fn mime ( path : & str ) -> Option < String > {
384- match path {
384+ let mut mime = match path {
385385 FAVICON_ICO_FILENAME => mime_guess:: from_ext ( "ico" ) ,
386386 FAVICON_PNG_FILENAME => mime_guess:: from_ext ( "png" ) ,
387387 _ => mime_guess:: from_path ( path) ,
388388 }
389- . first ( )
390- . map ( |m| m. to_string ( ) )
389+ . first ( ) ;
390+
391+ if mime. is_none ( ) {
392+ if let FileServerPath :: Physical ( p) = Self :: resolve ( path) {
393+ mime = mime_guess:: from_path ( & p) . first ( ) ;
394+ }
395+ }
396+
397+ mime. map ( |m| m. to_string ( ) )
391398 }
392399
393400 fn make_headers ( path : & str , enc : SupportedEncoding , etag : & str ) -> Vec < ( String , Vec < u8 > ) > {
You can’t perform that action at this time.
0 commit comments