Closed WoMayr closed 8 years ago
This is pretty strange. StaticFiles does not encode or decode files, there's no reason it should ever add a BOM. Are you generating the file and/or frequently editing it?
What's the rest of your setup? Kestrel? Kestrel + IIS / Express? Windows?
Windows 10 with Visual Studio 2015.
For testing purposes i have used the stock ASP.Net Core project (MVC Sample app) that ships with the Visual Studio SDK. I haven't changed anything, just added the file above into the wwwroot folder. The bug happens with both Kestrel and IIS Express. The HTML file is self written. I have tried it with Linux and Windows line endings and viewed the files with a binary editor to see if there are any suspicous characters in it.
EDIT: I have attached the solution where this happens: WebApplication2.zip
Investigate for 1.0
I am currently trying to migrate a RC1 web application with Angular 2 to RC2. But I have the problem that the StaticFile-Middleware sometimes cuts 3 charactes away from the end. (But the content-length seems to be the same since every browser reports a unexpected EOF). The interesting thing ist that once in a while it also prints a BOM at the beginning.
Also some pages seem to work where others fail.
This is the HTML-Page of the angular component where the error occurs:
I also tried with different browsers, fresh projects and double checked the encodings of those files.
EDIT: Interessting observation: when I delete the
<ol>
-Element the error disapears...EDIT 2: When I add the BOM in the actual source file. The characters don't get cut off.