首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WSO2微集成器自动跟踪重定向

WSO2微集成器自动跟踪重定向
EN

Stack Overflow用户
提问于 2021-08-25 03:54:12
回答 1查看 73关注 0票数 0

我正在使用HTTP v1.2.0今天我得到了一个关于WSO2状态代码307/301的问题。当目端点响应http代码307或301时,微集成器立即响应,而不是跟随重定向。

代码语言:javascript
复制
[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重定向?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-08-25 10:01:36

默认情况下,它不处理重定向。一种选择是在微集成器中通过查看HTTP代码来处理此问题。

代码语言:javascript
复制
<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://ei.docs.wso2.com/en/7.2.0/micro-integrator/use-cases/examples/routing_examples/routing_based_on_headers/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68916523

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档