Created
May 18, 2017 20:58
-
-
Save ericlaw1979/533f898c503429dbc4f89494c01d2cc9 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
public static void OnBeforeResponse(Session oSession) { | |
// If the response body starts with a Utf-8 signature, overwrite it with spaces | |
if (oSession.ResponseBody.Length > 3 && | |
oSession.ResponseBody[0] == 0xEF && | |
oSession.ResponseBody[1] == 0xBB && | |
oSession.ResponseBody[2] == 0xBF) | |
{ | |
oSession.ResponseBody[0] = 0x20; | |
oSession.ResponseBody[1] = 0x20; | |
oSession.ResponseBody[2] = 0x20; | |
oSession["ui-backcolor"] = "red"; | |
oSession.ResponseHeaders["old-Content-Type"] = oSession.ResponseHeaders["Content-Type"]; | |
oSession.ResponseHeaders["Content-Type"] = (oSession.ResponseHeaders["Content-Type"] + "; charset=utf-8"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment