dounei9043 2010-02-22 18:34
浏览 28
已采纳

使用referer标头加载图像

I'm trying to load an image dynamically. Seems like the server doesn't like me loading that image outside form their domain, so I always get with a 404, when in fact Firebug seems to load it and FF as well.

What's the best approach to remove the referrer header from the GET request sent to the server via the browser? I was thinking about a PHP proxy, but I will be happy if I can accomplish this using JavaScript.

I'm using Mootools.

  • 写回答

1条回答 默认 最新

  • doukekui0914 2010-02-22 18:56
    关注

    You cannot do this with JavasSript because it is a violation of the same origin policy. Checking the referer is a good method for preventing bandwidth theft and thats one of its few good security uses. If an attacker controls the browser the referer and the rest of the HTTP Header can be controlled with TamperData. If all of thoughs jpg's are killing your $4/mo unlimited bandwidth from some random shared host, perhaps a free image host will fill your needs.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 怎么解决LogIn.vue中多出来的div
  • ¥15 优博讯dt50巴枪怎么提取镜像
  • ¥30 在CodBlock上用c++语言运行
  • ¥15 求C6748 IIC EEPROM程序固化烧写算法
  • ¥50 关于#php#的问题,请各位专家解答!
  • ¥15 python 3.8.0版本,安装官方库ibm_db遇到问题,提示找不到ibm_db模块。如何解决?
  • ¥15 TMUXHS4412如何防止静电,
  • ¥30 Metashape软件中如何将建模后的图像中的植被与庄稼点云删除
  • ¥20 机械振动学课后习题求解答
  • ¥15 IEC61850 客户端和服务端的通讯机制
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部