从猎鹰认证重定向 [英] Redirect from falcon authenticate
本文介绍了从猎鹰认证重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的猎鹰应用程序中,我想从身份验证功能重定向到另一个页面.
In my falcon app I want to redirect to another page from the authenticate function.
我正在这样做:
resp.status = falcon.HTTP_301
resp.set_header('Location', '/http://foo.bar.com:8004/falcon_passthrough/')
但是它仍然在返回时调用底层端点,并且不会重定向.
But it still calls the underlying endpoint on return and does not redirect.
有没有一种方法可以导致这种重定向而不调用基础端点?
Is there a way to cause this redirect and not call the underlying endpoint?
推荐答案
如果您使用的是1.0.0rc1
,请执行以下操作:
If you are using 1.0.0rc1
just do:
raise falcon.HTTPMovedPermanently(location)
这篇关于从猎鹰认证重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文