dpbl91234 2014-05-27 22:33
浏览 631

407需要代理身份验证(Forefront TMG需要授权才能完成请求。拒绝访问Web代理筛选器。)

I have developed a website which uses Ajax POST using jQuery to a PHP server.

While it works perfectly when accessed from a web browser at home, some of my Ajax requests fail when accessed from a web browser on my day job's corporate network, and I get the following error shown by Firebug: 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ). Note that Chrome does not show the error but it is still blocked, and IE11 blocks it as well but I haven't been able to view the message using Development Tools due to an unrelated issue (Error in jquery.validate.js in MVC 4 Project with jQuery 1.9).

I have no ability to modify anything on the corporate network, nor is it my desire to do so. My desire is to modify the HTML/JavaScript/Headers which my server provides to eliminate blocking of the request so others do not experience this issue.

What can be done?

  • 写回答

1条回答

  • dprh34164 2014-08-25 15:57
    关注

    This happens when you are using a complete url address in your html or jquery posts e.g.

    action="http://www.example.com/mydir/myfile.php"
    

    Try changing the url reference so that it doesn't include the website address e.g.

    action="/mydir/myfile.php"
    

    This also works when posting with AJAX/jquery e.g. the code below produces the same error

    var url1="http://www.example.com/mydir/myfile.php";
    $.post(url1, function(data){alert(data);});
    

    but this code doesn't

    var dir1="/mydir/myfile.php";
    $.post(dir1, function(data){alert(data);});
    

    It is important to note that when you switch from the complete urls to the directories, you have to define your directory relative to your current file directory.

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器