我有一个使用审计记录器插件设置的 restify api,我可以选择将主体设置为 true,但我希望能够过滤或删除在主体和标头上发送的参数,例如密码或令牌目前正在保存在 restify 的日志中。
当前日志示例:
req: {
"headers": {
"authorization": "Token token=**youshouldnotseeme**,provider=**hellno**",
"date": "Wed, 09 Oct 2013 17:10:53 GMT",
"host": "localhost:8082",
"connection": "keep-alive"
}
"body": {
"username": "somedude",
"password": "**youshouldnotseeme**"
}
}
我想要的示例:
req: {
"headers": {
"authorization": "Token token=**[FILTERED]**,provider=**[FILTERED]**",
"date": "Wed, 09 Oct 2013 17:10:53 GMT",
"host": "localhost:8082",
"connection": "keep-alive"
}
"body": {
"username": "somedude",
"password": "**[FILTERED]**"
}
}
那么我怎么能做到这一点呢?
谢谢你。