[英]How do we redirect to a cross domain URL from a Mule 4 application?
我正在嘗試使用 Mule 4 應用程序重定向到外部網站 URL 但只有端點正在更改,保持相同的(舊頁面)域。 但我需要更改端點以及外部域。
我正在使用 HTTP 請求連接器來執行此操作。
這是我們的一些 XML 代碼:
<http:request-config name="HTTP_Request_configuration" doc:name="HTTP Request configuration" doc:id="14a8eee1-b907-4306-86da-d46eee402a56" >
<http:request-connection protocol="HTTPS" host="partners.checkr.com" port="443" />
</http:request-config>
<flow name="OAuth2Flow" doc:id="fedc6c32-82fa-4e7d-bc4a-6425daf0642c" >
<http:listener doc:name="Listener" doc:id="157b2a3d-ea31-4496-9808-b2b43058cccd" config-ref="HTTP_Listener_config" path="/"/>
<http:request method="GET" doc:name="Request" doc:id="0502ced7-b52d-4f64-aee1-ed3525998fed" config-ref="HTTP_Request_configuration" path="/" followRedirects="true"/>
</flow>
</mule>
重定向應該以這樣的方式發生,即整個 URL 應該被重定向(域 + 端點)。
要將它們完全重定向到不同的域並離開您的 mule 應用程序,您可以設置 302 狀態和位置 header:
<flow name="OAuth2Flow" doc:id="2e0b1fe9-0d1f-48a1-9d35-d272509de426" >
<http:listener doc:name="Listener" doc:id="45692a0f-8c10-47c3-8b26-5bb9e7a715d5" config-ref="HTTP_Listener_config" path="/">
<http:response statusCode="302" >
<http:headers ><![CDATA[#[output application/java
---
{
"Location" : "https://partners.checkr.com/"
}]]]></http:headers>
</http:response>
</http:listener>
<logger level="INFO" doc:name="Logger" doc:id="66629470-b152-498d-9a37-801873348698" />
</flow>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.