Apache NiFi的InvokeHTTP和其他HTTP处理器是否将Authorization标头发送到重定向的URL? [英] Do Apache NiFi's InvokeHTTP and other HTTP processors send an Authorization header to redirected URLs?
问题描述
如果我已经配置了带有承载令牌的属性Authorization
,InvokeHTTP会将该标头发送到重定向 URL吗?
If I have configured a property Authorization
with a bearer token, will InvokeHTTP send that header to the redirected URL?
我在文档中找不到任何相关内容.在OkHttp(InvokeHTTP的基础库)的源代码中,我似乎也找不到清晰的文字.
I can't find anything in the documentation about it. I also can't seem to find clarity in the source of OkHttp, the underlying library for InvokeHTTP.
是否有一种方法可以基于URL从重定向URL中 strip 标头?
Is there a way to strip a header from a redirected URL based on the URL?
我可能会很快进入使用ExecuteGroovyScript"领域.
I may quickly be getting into "use ExecuteGroovyScript" territory here.
推荐答案
The short answer is no, because OkHttp strips Authorization
on redirects:
// When redirecting across hosts, drop all authentication headers. This
// is potentially annoying to the application layer since they have no
// way to retain them.
if (!sameConnection(userResponse, url)) {
requestBuilder.removeHeader("Authorization");
}
我们非常感谢 https://stackoverflow.com/a/52285990/204052 .
这篇关于Apache NiFi的InvokeHTTP和其他HTTP处理器是否将Authorization标头发送到重定向的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!