有没有办法确定跨域图像请求的源页面?

时间:2023-01-11 19:37:24

I'm working on a set of sites that use a lot of cross-domain immge requests (our own site), and am getting a lot of 404 errors in our logs, but can't identify any actual pages where the images aren't showing. Does anyone know of any method that can be used to find out what page requests contains the bad image references?

我正在研究一组使用大量跨域移民请求(我们自己的网站)的网站,并且在我们的日志中收到了大量404错误,但是无法识别图像所在的任何实际页面。显示。有没有人知道任何可用于找出哪些页面请求包含错误图像引用的方法?

It occurs to me I could write an HttpModule for use on the sites to scan all pages for image references, and do some logging that I can use to track down the offending pages, but I wanted to see if there was as easier method first.

它发生在我身上我可以编写一个HttpModule用于在网站上扫描所有页面以进行图像引用,并做一些我可以用来追踪有问题的页面的日志记录,但我想先看看是否有更简单的方法。

1 个解决方案

#1


1  

The request should have an 'Origin' header that specifies the calling domain. This header is set by the browser and can't be spoofed. The 'Referer' header will give you the full url to the calling page. You could write these header values to your log.

请求应具有指定调用域的“Origin”标头。此标头由浏览器设置,不能欺骗。 “Referer”标题将为您提供调用页面的完整URL。您可以将这些标头值写入日志。

#1


1  

The request should have an 'Origin' header that specifies the calling domain. This header is set by the browser and can't be spoofed. The 'Referer' header will give you the full url to the calling page. You could write these header values to your log.

请求应具有指定调用域的“Origin”标头。此标头由浏览器设置,不能欺骗。 “Referer”标题将为您提供调用页面的完整URL。您可以将这些标头值写入日志。