Do Apache NiFi's InvokeHTTP and other HTTP pro

2019-07-15 03:14发布

If I have configured a property Authorization with a bearer token, will InvokeHTTP send that header to the redirected URL?

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.

Is there a way to strip a header from a redirected URL based on the URL?

I may quickly be getting into "use ExecuteGroovyScript" territory here.

1条回答
我想做一个坏孩纸
2楼-- · 2019-07-15 04:06

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");
}

We know this thanks to https://stackoverflow.com/a/52285990/204052.

查看更多
登录 后发表回答