草庐IT

unsafe_guard

全部标签

javascript - 如何对所有路由 Root 和 Child Routes 使用 angular 6 Route Auth Guards?

如何为所有路由Root和ChildRoutes使用angular6RouteAuthGuards? 最佳答案 1)[创建守卫,文件名类似于auth.guard.ts]nggenerateguardauthimport{Injectable}from'@angular/core';import{CanActivate,ActivatedRouteSnapshot,RouterStateSnapshot}from'@angular/router';import{Observable}from'rxjs/Observable';impor

javascript - 使用 iframe 嵌入 Youtube 视频给出 "Unsafe JavaScript attempt ... "

我正在尝试使用以下代码嵌入YouTube视频:虽然它工作正常,但它在控制台中给出了这个错误:Chromeversion22.0.1229.94:UnsafeJavaScriptattempttoaccessframewithURLhttp://example.com/fromframewithURLhttp://www.youtube.com/embed/8vJwFvFi4ZY?wmode=transparent.Domains,protocolsandportsmustmatch.Firefox版本17.0:Error:Permissiondeniedtoaccessproperty

javascript - CSP : How to allow unsafe-eval for a given URI prefix (Firefox)

我正在尝试使用MathJax作为我们网络应用程序的一部分,它使用非常严格的ContentSecurityPolicy(CSP).问题是MathJax被编码为使用eval()[确切地说,以Function()的形式],默认情况下CSP认为它不安全。我目前正在使用以下CSPheader:X-Content-Security-Policy:allow'self';img-src*;media-src*;frame-src*;font-src*;frame-ancestors'none';style-src*;report-uri'/:save-csp-violation';这会导致MathJ

javascript - Ajax 请求 : Refused to set unsafe header

我正在尝试使用GoogleText-To-Speech播放音频。因此,我需要使用正确设置的Referer和User-Agent向他们的端点发送请求。此调用应返回我可以播放的MP3。但是,我得到了Refusedtosetunsafeheader错误。这是我的代码。我该怎么做?$.ajax({url:'http://translate.google.com/translate_tts?ie=UTF-8&q=Hello&tl=en&client=t',beforeSend:function(xhr){xhr.setRequestHeader("Referer","http://transla

php - 如何为同一个 Controller 使用 laravel Multiple Auth Guard

拉拉维尔5.2我有下面给出的多重授权GardAdminClientsEmployee我有ItemController->index.blade.php->create.blade.php->edit.blade.phpItemKitController->index.blade.php->create.blade.php->edit.blade.php我想使用Client和EmployeeGuard访问同一个Controller并查看上面提到的内容。是他们的任何可能方式。 最佳答案 也许你想要这样的东西publicfunction_

php - 如何寻址 "Refused to Set Unsafe Header: Connection"?

我将Prototype与CodeIgniter结合使用来提交AJAX请求。我的浏览器是Chrome。我在控制台中收到一条错误消息,内容为“拒绝设置不安全header:连接”。这是Ajax请求行:newAjax.Request('/vbs/index.php/signup/get_ratecenters',{method:'POST',evalScripts:true})我试图将类型设置为同步,但收到了同样的错误。有人可以帮忙吗?提前致谢。 最佳答案 prototype.js(1.7.0.0)中只有一个代码片段尝试设置Connecti

php - Laravel [5.2.21] 自定义 Auth Guard 不持久

我正在尝试设置自定义身份验证保护,一切正常。我能够登录Model,但是一旦我将访问者重定向到新页面,身份验证就会丢失。我可以在Controller执行重定向之前dd()Auth::guard('client')->user()就好了,但是在AuthenticateClient中间件。我正在使用默认的保护程序来验证用户,并且一切正常。我已确保路由位于启用session的web中间件下。我搜索过类似的问题,但找不到有效的解决方案。有什么解决办法吗?旁注:我知道我在下面的代码示例中使用了token,但我所做的不仅仅是针对该token进行验证。所以这是一个不同于为api验证token的系统。路

php - Laravel 5.2 Auth facade 和 Auth::guard($guard)

我是Laravel的新手。我正在浏览默认的身份验证中间件,我看到它正在使用:Auth::guard($guard)->guest()检查用户是否是访客。文档位于https://laravel.com/docs/5.2/authentication#retrieving-the-authenticated-user告诉我们可以使用:Auth::check()确定用户是否通过身份验证。(我想这与guest()相反?我尝试更改要使用的默认代码Auth::guest()我得到了完全相同的结果。我的问题是,在这种情况下,有没有guard($guard)->有什么区别?一个相关的问题。guest(

php - Apache 不会加载 Zend Guard Loader

我正在使用具有以下设置的Ubuntu15.04-64位:ApacheServerversion:Apache/2.4.10(Ubuntu),Serverbuilt:Jul24201517:25:18PHPPHP5.6.4-4ubuntu6.2(cli)(built:Jul2201515:29:28)Copyright,(c)1997-2014ThePHPGroupZendEnginev2.6.0,Copyright(c),1998-2014ZendTechnologieswithZendOPcachev7.0.4-dev,Copyright,(c)1999-2014,byZendTec

php - Laravel: Trait method guard 没有被应用,因为与 App\Http\Controllers\Auth\AuthController 上的其他 trait 方法有冲突

我正在更新到Laravel5.4并收到此错误消息:Traitmethodguardhasnotbeenapplied,becausetherearecollisionswithothertraitmethodsonApp\Http\Controllers\Auth\AuthController这是我的AuthController类。middleware($this->guestMiddleware(),['except'=>['getLogout']]);}/***Getavalidatorforanincomingregistrationrequest.**@paramarray$d