我正在使用HTTP v1.2.0今天我得到了一个关于WSO2状态代码307/301的问题。当目端点响应http代码307或301时,微集成器立即响应,而不是跟随重定向。
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "GET /destination_endpoint HTTP/1.1[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Authorization: Basic Y3VjX3FsZHQ6Y3VjX3FsZHQ=[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Accept: text/plain, application/json, application/x-jackson-smile, application/cbor, application/*+json, */*[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Accept-Encoding: gzip,deflate[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "request_id: a16b98a9-8efa-4ff1-9060-83a82f9c4786[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Host: destination_host[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "Connection: Keep-Alive[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]"
[2021-08-25 10:34:40,722] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 << "[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "HTTP/1.1 307 Temporary Redirect[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Server: nginx[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Date: Wed, 25 Aug 2021 04:32:43 GMT[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Type: text/html[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Length: 180[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Connection: keep-alive[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Set-Cookie: BPC=625112d03351499b4eb22e1d9286a164; path=/[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Location: https://redirects_url/[\r][\n]"
[2021-08-25 10:34:40,754] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Strict-Transport-Security: max-age=15768000 always; includeSubdomains; preload[\r][\n]"
[2021-08-25 10:34:40,769] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Frame-Options: DENY[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Content-Type-Options: nosniff[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "<html>[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "<head><title>307 Temporary Redirect</title></head>[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "<body bgcolor="white">[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "<center><h1>307 Temporary Redirect</h1></center>[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "<hr><center>nginx</center>[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "</body>[\r][\n]"
[2021-08-25 10:34:40,785] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "</html>[\r][\n]"我搜索了互联网上的一切,但仍然没有任何解决方案,自动跟踪重定向在微集成器。
谁知道如何配置HTTP微积分器自动跟随wso2代码307或301重定向?
发布于 2021-08-25 10:01:36
默认情况下,它不处理重定向。一种选择是在微集成器中通过查看HTTP代码来处理此问题。
<filter source="$axis2:HTTP_SC" regex="301">
<then>
<log level="custom">
<property name="----Working on 301--------" value="TRUE"/>
</log>
<property name="locationvalue" expression="$trp:Location"/>
// call the endpoint in the location header.
</then>
<else>
<log level="custom">
<property name="---------------respose----------------------" value="Execute other scenarios"/>
</log>
</else>
</filter>https://stackoverflow.com/questions/68916523
复制相似问题