带有 Internet Explorer 11 的 Angularjs,安全问题 [英] Angularjs with Internet Explorer 11, security issue

查看:22
本文介绍了带有 Internet Explorer 11 的 Angularjs,安全问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Angularjs 已经有几个月了,它在 Chrome/Firefox/Safari 中的作用就像一个魅力,但在 IE11 和 Edge 上遇到了一些问题.

我的问题似乎来自 ng-src,因为没有显示图像并且从未设置 src 属性.

代码如下:

 <div class="cell col-xs-12 col-sm-6 col-md-4 col-lg-3" ng-repeat="obj in DATA.objects | orderBy:objectsOrder track by$index"><div ng-click="setCurrent($event, obj, '{{'obj_nav_' + $index}}')"><img ng-src="{{formatURL(obj.Id, obj.img.fileName)}}"></img><div><p ng-bind="obj.name"/><p ng-bind="obj.address"/>

formatURL 是一个范围函数,用于格式化 URL 以获取图像,例如格式化的 url 将是 "https://user1:mdp@mydomain.com/objId/imageName".

这里是错误:

错误:出现安全问题.

在 Aa (http://192.168.9.97/web/app/lib/angular/angular.min.js:147:46)在匿名函数 (http://192.168.9.97/web/app/lib/angular/angular.min.js:137:142)在 Z.prototype.$set (http://192.168.9.97/web/app/lib/angular/angular.min.js:76:149)在匿名函数 (http://192.168.9.97/web/app/lib/angular/angular.min.js:242:344)在匿名函数 (http://192.168.9.97/web/app/lib/angular/angular.min.js:77:72)在米 (http://192.168.9.97/web/app/lib/angular/angular.min.js:7:320)在 Z.prototype.$set (http://192.168.9.97/web/app/lib/angular/angular.min.js:77:49)在匿名函数 (http://192.168.9.97/web/app/lib/angular/angular.min.js:71:500)在匿名函数 (http://192.168.9.97/web/app/lib/angular/angular.min.js:95:444)在匿名函数 (http://192.168.9.97/web/app/lib/angular/angular.min.js:128:156)

此错误消息是使用 Angularjs 1.4.7 引发的.请注意,当我第一次遇到问题时,我使用的是 1.3.0-rc5,然后我更新了 Angular,但仍然遇到同样的问题.我在 Edge 中遇到了完全相同的错误.

解决方案

我终于在这里找到了答案 微软.Microsoft 不允许用户使用 http://login:password@url 格式来防止隐藏 url.>

I'm using Angularjs for some months and it works like a charms in Chrome/Firefox/Safari but face some problems with IE11 and Edge.

It seems my problem come from ng-src since images are not displayed and src attribute is never set.

Here is the code:

 <div class="cell col-xs-12 col-sm-6 col-md-4 col-lg-3" ng-repeat="obj in DATA.objects | orderBy:objectsOrder track by $index ">
    <div ng-click="setCurrent($event, obj, '{{'obj_nav_' + $index}}')">
        <img ng-src="{{formatURL(obj.Id, obj.img.fileName)}}"></img>
        <div>
            <p ng-bind="obj.name"/>
            <p ng-bind="obj.address"/>
        </div>
    </div>
 </div>

formatURL is a scope function that format the URL to get images, for instance the formatted url will be "https://user1:mdp@mydomain.com/objId/imageName".

Here is the error:

Error: A security issue has occurred.

at Aa (http://192.168.9.97/web/app/lib/angular/angular.min.js:147:46) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:137:142) at Z.prototype.$set (http://192.168.9.97/web/app/lib/angular/angular.min.js:76:149) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:242:344) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:77:72) at m (http://192.168.9.97/web/app/lib/angular/angular.min.js:7:320) at Z.prototype.$set (http://192.168.9.97/web/app/lib/angular/angular.min.js:77:49) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:71:500) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:95:444) at Anonymous function (http://192.168.9.97/web/app/lib/angular/angular.min.js:128:156)

This error message was thrown using Angularjs 1.4.7. Note that I was using 1.3.0-rc5 when I first faced the problem then I update Angular but still got the same problem. I got exactly the same error in Edge.

解决方案

I finally found the answer here Microsoft. Microsoft doesn't allow user to use http://login:password@url format to prevent hidden url.

这篇关于带有 Internet Explorer 11 的 Angularjs,安全问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆