知道HTTP请求是否来自Chrome URL自动完成? [英] Know if HTTP request is from Chrome URL auto-complete?
问题描述
我们有一个响应 GET / logout
的Web应用程序,并删除您的会话Cookie。如果您开始在网址列中输入任何其他含有 / l
的网址,Chrome会自动建议 / logout
。当它这样做时,它会请求 / logout
预取内容。我的HTTP服务器如何知道请求是否来自这种预取行为?
b
$ b
我试过的:
'Cache-Control':'no-cache,no-store'
告诉浏览器不缓存来自 GET / logout
将您的注销更改为使用POST而不是GET。
We have a web application that responds to GET /logout
and deletes your session cookies. If you start typing any other URL that beings with /l
into the URL bar, Chrome will auto-suggest /logout
. When it does this, it makes a request to /logout
to pre-fetch the content. The result is that the user is un-expectedly logged out.
How can my HTTP server know if a request is from this pre-fetch behavior?
What I've tried:
- Inspecting the request headers for something unique. I do not see anything unique from the pre-fetch request.
- Using
'Cache-Control': 'no-cache, no-store'
to tell the browser to not cache the response fromGET /logout
Change your logout to use POST instead of GET.
这篇关于知道HTTP请求是否来自Chrome URL自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!