Why does Http header contains "X-SourceFiles"?

Question:

Using a FileStreamResult in ASP.NET MVC 3, I get a response header like

X-SourceFiles =?UTF-8?B?RDpcUHJvamVjdFxqYWNvYlx0ZXN0?=

Answer:
The header is understood by certain debugging modules in IIS / IIS Express. It contains the base64-encoded path to the source file on disk and is used to link a page's generated output back to that source file. It's only generated for localhost requests, so you don't need to worry about it being displayed to the world when you deploy the application to an actual server.

Updated:

It is not the root cause. I re-checked this issue. only IE has this problem, Chrome is ok. It is caused by the Chinese file name. if the file name doesn't have double byte char, all are ok.  The workaround is to escape the file name when client browser is IE

... 
   string bName = HttpContext.Current.Request.Browser.Browser;
            if (bName  == "InternetExplorer")
            {
                fileName = Uri.EscapeDataString(fileName);
            }    

  result.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
  result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");

  result.Content.Headers.ContentDisposition.FileName = fileName;
  result.Content.Headers.Add("x-filename", fileName);

...
原文地址:https://www.cnblogs.com/xixifusigao/p/3953279.html