Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 gorilla 工具包 mux 来路由请求,我有几个使用路径前缀的子路由,问题是我想获取完整的请求路径,但 req.URL.path 只有路径前缀之后的部分 url 所以如何我得到一个包含路径前缀的路径吗?提前致谢
尝试req.Referer()
req.Referer()
它是从标头值中检索的,您不能保证它不会被欺骗。