Skip to content

WebServer - MIME-Type for images not correct #1214

@DaveSchmid

Description

@DaveSchmid

Library/API/IoT binding

nanoFramework.WebServer

Visual Studio version

No response

.NET nanoFramework extension version

No response

Target name(s)

ESP32_REV0

Firmware version

1.8.0.877

Device capabilities

ESP32 (ESP32-D0WDQ6 (revision 1))
Features WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Flash size 4MB unknown from ST (manufacturer 0x32 device 0x16406)
PSRAM: undetermined
Crystal 40MHz
MAC 24:6F:28:9E:31:30

Description

MIME-Type for png images should be "image/png" not "image".
If the MIME type is wrong, the browser (Chrome) does not display the file but opens a save file dialog.

How to reproduce

  1. Start modified WebServer.Sample
  2. open Chrome request:
  3. analyzes Content types in Chrome Dev tool

2023-01-21_21-40-42

Expected behaviour

MIME type for the most important file extensions according to IANA. (or https://wiki.selfhtml.org/wiki/MIME-Type/%C3%9Cbersicht)

Screenshots

No response

Sample project or code

Modified WebServer.Sample with modified GetContentTypeFromFileName from WebServer.cs :
https://github.com/DaveSchmid/Samples/releases/tag/WebServer.Sample-Errors
Sample shows misbehave of wrong MIME-Type.

Aditional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions