码迷,mamicode.com
首页 > 其他好文 > 详细

服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF

时间:2014-07-31 20:06:37      阅读:378      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   cti   ar   div   new   

解决办法:

ToggleAllowUnsafeHeaderParsing(true);
public static bool ToggleAllowUnsafeHeaderParsing(bool enable)
        {
            Assembly assembly = Assembly.GetAssembly(typeof(SettingsSection));
            if (assembly != null)
            {
                Type settingsSectionType = assembly.GetType("System.Net.Configuration.SettingsSectionInternal");
                if (settingsSectionType != null)
                {
                    
                    object anInstance = settingsSectionType.InvokeMember("Section",
                    BindingFlags.Static | BindingFlags.GetProperty | BindingFlags.NonPublic, null, null, new object[] { });
                    if (anInstance != null)
                    {
                        FieldInfo aUseUnsafeHeaderParsing = settingsSectionType.GetField("useUnsafeHeaderParsing", BindingFlags.NonPublic | BindingFlags.Instance);
                        if (aUseUnsafeHeaderParsing != null)
                        {
                            aUseUnsafeHeaderParsing.SetValue(anInstance, enable);
                            return true;
                        }

                    }
                }
            }
            return false;
        }

 

服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF,布布扣,bubuko.com

服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF

标签:style   blog   color   io   cti   ar   div   new   

原文地址:http://www.cnblogs.com/aochulai/p/3881415.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!