本文介绍了如何填充request.header.authorization?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正从Express过渡到Restify,我编写了一个模块来检查我使用express-session的授权,然后再使用它.
现在,在重新验证时,request.headers.authorization返回未定义,所以我的问题是:我可以添加一些代码来告诉我重新填充此字段吗?
解决方案
好的,很抱歉我在认证/授权过程中的文盲!问题是我没有在授权"请求中发送任何标题!现在,它无需任何新代码即可工作.
I'm passing from express to restify and I wrote a module to check my authorization that used express-session and before it worked well.
Now, on restify, the request.headers.authorization return undefined so my question is:can I add some code to tell to restify to fill this field?
解决方案
Ok, sorry for my illiteracy in autentication/authorization process!The problem was that I didn't send any headers on "authorization" request!Now it works without any new code.
这篇关于如何填充request.header.authorization?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!