Do Apache NiFi's InvokeHTTP and other HTTP processors send an Authorization header to redirected URLs?

我的未来我决定 提交于 2019-12-12 18:43:09

问题


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:


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.



来源:https://stackoverflow.com/questions/52284452/do-apache-nifis-invokehttp-and-other-http-processors-send-an-authorization-head

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!