At the end of every page that runs through the IIS pipeline that emits a Content-Type with charset (per the <globalization>
element), the UTF-8 BOM is added at the end of the response. This is invalid and breaks UpdatePanel usages.
If the BOM is added, it should be the first character..
curl | xxd
shows the last three bytes as EF BB BF
, or the UTF-8 BOM.
0002b830: 2f62 6f64 793e 0d0a 3c2f 6874 6d6c 3eef /body>..</html>.
0002b840: bbbf ..
Notes:
This issue does not plague the responses that come via the Static File handler. This indicates the issue is within the managed / ASP.NET pipeline.
This issue still occurs if calling
Request.End()
immediately after writing some dummy data. This should imply that the the issue is not caused by any further request handler or soft-wrapper, as it results in ThreadAbortException propagation.MVC and ASP.NET WebForm pages are affected in the same way.
ASHX requests are not affected.
The issue started, or at least became very apparent, when changing to use
<globalization responseEncoding="utf-8" ..>
.Such a BOM / character does indeed not appear at the end of the source files used in the requests, much less in every single file affected.. (the codebase has no non-starting/BOM occurrences of
\xEF\xBB\xBF
, nor any occurrences of\xFE\xFF
or\xFF\xFE
.)
All IIS modules that do not ship with IIS or ASP.NET MVC have already been removed and the issue persists.
What may be the issue, and what are the next steps in troubleshooting?