Apache NiFi的InvokeHTTP和其他HTTP处理器是否会向重定向的URL发送授权标头?

问题描述 投票:2回答:1

如果我使用承载令牌配置了属性Authorization,那么InvokeHTTP会将该头发送到重定向的URL吗?

我在文档中找不到任何关于它的内容。我似乎也无法清楚地了解InvokeHTTP的底层库OkHttp的来源。

有没有办法根据URL从重定向的URL中删除标题?

我可能会很快进入“使用ExecuteGroovyScript”领域。

http authorization apache-nifi
1个回答
2
投票

简短的回答是否定的,因为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

© www.soinside.com 2019 - 2024. All rights reserved.