[英]How to create a global whitelist of trusted URLs?
我想概括為在角2同樣,通過其$ sceDelegateProvider由AngularJS提供繞過資源的URL,以落實安全URL的全局白名單功能,在這里
我曾嘗試參考 Angular 文檔,但似乎找不到任何幫助。
使用 angular,您可以使用 sanitize 功能。 文檔鏈接: https : //angular.io/api/platform-browser/DomSanitizer#sanitize
let url = this.sanitiser.sanitise(SecurityContext.URL, urlVariable);
這將清理 url。
我還建議您查看 owasp 網站以獲取安全網址。 他們有正則表達式,在apst 中對我有用。 以下鏈接: https : //www.owasp.org/index.php/OWASP_Validation_Regex_Repository
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.