我们有一个 Apache Camel (2.13.2) 应用程序,它使用 http4 与网络服务器通信,并使用 NTLM 进行身份验证。
端点定义为(伪):
...
.to("http4://thegreat.server.com/uri?authUsername=" + user + "&authPassword=" + pass
+ "&authenticationPreemptive=true&authMethod=NTLM&authDomain=DOMAIN&authHost=host")
.to("otherEndpoint");
只要pass
变量包含“非特殊”字符。
然而,如果pass
例如包含"abcd&def"
- Camel 会将 & 符号解释为查询参数分隔符,正如它应该的那样。
但是 url 编码 & 符号(即"abcd%26def"
)根本没有区别吗?
我们最终还是会看到 Camel 调用端点"http://thegreat.server.com/uri?authMethod=NTLM&def="
,带有截断的密码。
我们是否遗漏了一些明显的东西,或者这看起来像一个错误吗?
Thanks.
请参阅Camel文档如何配置端点uri
- http://camel.apache.org/how-do-i-configure-endpoints.html http://camel.apache.org/how-do-i-configure-endpoints.html
有一节介绍了密码,例如您应该使用 RAW() 语法。
所以这会是类似的东西
.to("http4://thegreat.server.com/uri?authUsername=" + user + "&authPassword=RAW(" + pass
+ ")&authenticationPreemptive=true&authMethod=NTLM&authDomain=DOMAIN&authHost=host")
.to("otherEndpoint");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)