Location headers in Laravel(Laravel 中的位置标头)
问题描述
我正在为我大学的身份验证系统 (Ucam_Webauth) 使用图书馆,这意味着我必须通过其中一种方法重定向到身份验证服务器.不幸的是,由于该库的体系结构,我无法返回 Redirect:to().该库本身使用 header('Location: ...'); 但这由于某种原因不起作用.
I'm working with a Library for my university's authentication system (Ucam_Webauth) which means I have to redirect to the authentication server in one of the methods. Unfortunately, I cannot return a Redirect:to() because of the architecture of this library. The library itself uses header('Location: ...'); but this isn't working for some reason.
如果我在发送标头后使程序 die(); 可以工作,否则就不行.
If I make the programme die(); after sending the header it works, but otherwise it doesn't.
知道如何解决这个问题吗?
Any idea how I can fix this?
推荐答案
return redirect()->to('url')->send();
发送 HTTP 标头和内容.在我的应用程序中,send() 方法的作用类似于 'exit()' 并且是可测试的
Sends HTTP headers and content. In my application, send() method acts like 'exit()' and is testable
这篇关于Laravel 中的位置标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Laravel 中的位置标头
				
        
 
            
        - Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
 - 如何定位 php.ini 文件 (xampp) 2022-01-01
 - 没有作曲家的 PSR4 自动加载 2022-01-01
 - SoapClient 设置自定义 HTTP Header 2021-01-01
 - Laravel 仓库 2022-01-01
 - Mod使用GET变量将子域重写为PHP 2021-01-01
 - 从 PHP 中的输入表单获取日期 2022-01-01
 - 正确分离 PHP 中的逻辑/样式 2021-01-01
 - PHP Count 布尔数组中真值的数量 2021-01-01
 - 带有通配符的 Laravel 验证器 2021-01-01
 
				
				
				
				