ASP.NET Request.Url 重复 URL 3 次

发布于 2024-07-30 02:13:32 字数 725 浏览 1 评论 0原文

我有一个 HttpHandler,每当访问图像扩展时就会调用它。 这是我在 HttpHandler 中进行的简单测试:

public void ProcessRequest(HttpContext context)
{       
    context.Response.Write(context.Request.Url.ToString());
    context.Response.End();
}

根据 Firebug,第一次刷新页面 (Ctrl+F5) 时,URL 在响应中正确显示。 但是,如果我再次刷新(F5),它将重复该 URL 3 次:

第一次:

http://server/image.jpg

后续时间:

http://server/image.jpghttp //server/image.jpghttp://server/image.jpg

有谁知道为什么会发生这种情况?

I have a HttpHandler that is called whenever an image extension is accessed. This is what I have in the HttpHandler as a simple test:

public void ProcessRequest(HttpContext context)
{       
    context.Response.Write(context.Request.Url.ToString());
    context.Response.End();
}

According to Firebug, the first time the page is refreshed (Ctrl+F5), the URL is shown correctly in the response. However, if I refresh it again (F5), it'll repeat the URL 3 times:

First time:

http://server/image.jpg

Subsequent times:

http://server/image.jpghttp://server/image.jpghttp://server/image.jpg

Does anyone know why this is happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨的味道风的声音 2024-08-06 02:13:33

我尝试了您的代码并在不同的浏览器中刷新页面,并且没有重复的 URL。

I tried your code and refresh page in different browsers and there is no repeating URL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文