我正在使用Websphere Portal
并尝试通过AJAX
发出Proxy
请求,但获取404
状态代码。
当我使用自定义标头设置发出以下请求时,我得到404
:
GET http://proxy.com:10039/wps/proxy/https/server.com/cart/@self
但是如果我发出不通过代理路由的相同请求,我会得到200
GET https://server.com/cart/@self
为什么代理会删除我的标题?
我在目标服务器上记录了所有标头,并看到标题在通过代理时实际被删除了:
{accept=*/*, accept-encoding=gzip,deflate,sdch, accept-language=en-US,en;q=0.8, cache-control=no-cache, connection=keep-alive, host=server.com, pragma=no-cache, user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36}
这是我的代理配置:
<policy url="{$digital_data_connector_policy}" basic-auth-support="true" name="digital_data_connector">
<actions>
<method>GET</method>
<method>HEAD</method>
<method>POST</method>
<method>DELETE</method>
<method>PUT</method>
</actions>
<headers>
<header>User-Agent</header>
<header>Accept*</header>
<header>Content*</header>
<header>Authorization*</header>
<header>Set-Cookie</header>
<header>If-Modified-Since</header>
<header>If-None-Match</header>
<header>If-Unmodified-Since</header>
<header>X-Method-Override</header>
<header>Set-Cookie</header>
<header>MyCustomToken</header>
<header>MyCustomTokenPart2</header>
</headers>
<meta-data>
<name>forward-http-errors</name>
<value>true</value>
</meta-data>
<meta-data>
<name>forward-credentials-from-vault</name>
<value>true</value>
</meta-data>
</policy>
答案 0 :(得分:0)
我对proxy-config.xml
的更改在update-outbound-http-connection-config
任务运行之前未获取。