在startup.cs中的OutputFormatters中添加SupportedMediaTypes的安全性影响是什么?

时间:2019-01-14 07:04:08

标签: .net-core swagger asp.net-core-2.1 .net-core-2.1 outputformatter

我在startup.cs中使用以下代码。因为有个Swagger问题。

foreach (var outputFormatter in options.OutputFormatters.OfType<ODataOutputFormatter>().Where(_ => _.SupportedMediaTypes.Count == 0))
{
    outputFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/prs.odatatestxx-odata"));
}

foreach (var inputFormatter in options.InputFormatters.OfType<ODataInputFormatter>().Where(_ => _.SupportedMediaTypes.Count == 0))
{
    inputFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/prs.odatatestxx-odata"));
}

使用此代码有什么安全影响?

0 个答案:

没有答案