danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

charset set in Content-Type when it shouldn't be

geoffsmith82 opened this issue · comments

In MVCFramework.Router.pas when the MVCProduces attribute is not set on a Controller method but the Content-Type field is used to set it, the charset is set to utf-8 even for binary types .. ie.

Content-Type: application/zip; charset=utf8

I eventually found that setting
Config[TMVCConfigKey.DefaultContentCharset] := '';
solved my problem, but it was not obvious that is was the solution. Could it be changed so that the charset is accessible to be set like the Content-Type is and/or charset is cleared when the Content-Type is set.

Did you tried SendStream or SendFile ?

Fixed in 3.1.1-beryllium-RC3