gpt4 book ai didi

asp.net - 隐藏所有重定向信息

转载 作者:行者123 更新时间:2023-12-04 18:12:26 24 4
gpt4 key购买 nike

我正在使用 Response.Redirect 来提供媒体文件,但不希望人们看到文件的直接 url 或子域(主机)。是否可以伪造“get”并隐藏主机和引用者?

最佳答案

使用 Server.Transfer将请求处理转移到另一个页面。

When you use the Transfer method, the state information for all the built-in objects are included in the transfer. This means that any variables or objects that have been assigned a value in session or application scope are maintained. In addition, all of the current contents for the Request collections are available to the .asp file that is receiving the transfer.

Server.Transfer acts as an efficient replacement for the Response.Redirect method. Response.Redirect specifies to the browser to request a different page. Because a redirect forces a new page request, the browser makes two requests to the Web server, so the Web server handles an extra request. IIS 5.0 introduced a new function, Server.Transfer, which transfers execution to a different ASP page on the server. This avoids the extra request, resulting in better overall system performance, as well as a better user experience.



由于浏览器不会发出另一个请求,因此该 url 对浏览器完全隐藏,但它仍会获取将由您的重定向 url 提供的文件。

关于asp.net - 隐藏所有重定向信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12362266/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com