X-REQUEST-ID http标头是什么? [英] What is the X-REQUEST-ID http header?
问题描述
我已经在这个主题上进行了很多搜索,阅读了有关此标题,其在Heroku中的用法以及基于Django的项目的各种文章.
I have already googled a lot this subject, read various articles about this header, its use in Heroku, and projects based on Django.
但是,这一切仍然困扰着我.
However, it's still all confused in my head.
- 此标头的目的是什么?
- 它是否侵犯了用户隐私?
- 它可以帮助跟踪用户吗?
推荐答案
当您操作客户端访问的Web服务时,可能很难将请求(客户端可以看到的)与服务器日志相关联(服务器可以看到).
When you're operating a webservice that is accessed by clients, it might be difficult to correlate requests (that a client can see) with server logs (that the server can see).
X-Request-ID
的想法是,客户端可以创建一些随机ID并将其传递给服务器.然后,服务器在其创建的每个日志语句中都包含该ID.如果客户端收到错误,则可以在错误报告中包含该ID,从而允许服务器操作员查找相应的日志语句(而不必依赖时间戳,IP等).
The idea of the X-Request-ID
is that a client can create some random ID and pass it to the server. The server then include that ID in every log statement that it creates. If a client receives an error it can include the ID in a bug report, allowing the server operator to look up the corresponding log statements (without having to rely on timestamps, IPs, etc).
由于此ID由客户端(随机)生成,因此它不包含任何敏感信息,因此不应侵犯用户的隐私.由于每个请求都会创建一个唯一的ID,因此对跟踪用户也无济于事.
As this ID is generated (randomly) by the client it does not contain any sensitive information, and should thus not violate the user's privacy. As a unique ID is created per request it does also not help with tracking users.
这篇关于X-REQUEST-ID http标头是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!