0
我的目標是使用Server.TransferRequest發送自己的HTTP響應頭文件。Server.TransferRequest不發送傳遞的頭文件
我試圖做這樣的事情:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
var headers = new NameValueCollection
{
{"ErrorUrl", Context.Request.RawUrl},
{"ErrorCode", code.ToString()}
};
Server.TransferRequest("~400.html", true, "GET", headers);
但Chrome會顯示我響應頭:
Accept-Ranges:bytes
Content-Length:573
Content-Type:text/html
Date:Wed, 10 Aug 2016 14:32:36 GMT
ETag:"a9d0dad4fbd1d11:0"
Last-Modified:Wed, 29 Jun 2016 11:46:10 GMT
X-Content-Type-Options:nosniff
X-Frame-Options:deny
X-SourceFiles:=?UTF-8?B?RDpcS0ZTXE1haW5cUHJvZHVjdFxLREMuVXNlcldlYlxLREMuVXNlcldlYi5XZWJSb2xlXHNyY1xWaWV3c1xlcnJvclxlbi1VU1w0MDMuaHRtbA==?=
X-XSS-Protection:1
請幫助我獲得預期的頭。謝謝