Created
February 20, 2016 00:16
-
-
Save tanglebones/c0a6821e47dc469c6603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webHeaderCollectionType = typeof(WebHeaderCollection); | |
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(webHeaderCollectionType.TypeHandle); | |
try | |
{ | |
var hInfoFieldInfo = webHeaderCollectionType.GetField("HInfo", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Static); | |
var hInfo = hInfoFieldInfo.GetValue(null); | |
var hInfoType = hInfo.GetType().GetField("HeaderHashTable", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Static); | |
var hashtableOfHeaderInfos = hInfoType.GetValue(hInfo) as Hashtable; | |
foreach (var e in hashtableOfHeaderInfos.Values) | |
{ | |
var headerIsRequestRestrictedFieldInfo = e.GetType().GetField("IsRequestRestricted", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance); | |
headerIsRequestRestrictedFieldInfo.SetValue(e, false); | |
var headerIsResponseRestrictedFieldInfo = e.GetType().GetField("IsResponseRestricted", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance); | |
headerIsResponseRestrictedFieldInfo.SetValue(e, false); | |
} | |
} | |
catch (Exception ex) | |
{ | |
System.Diagnostics.Debug.WriteLine("total hack failed: " + ex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment