You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "soulbird (via GitHub)" <gi...@apache.org> on 2023/04/17 06:07:56 UTC

[GitHub] [apisix] soulbird commented on a diff in pull request #9267: fix: body-transformer should have a smaller priority than proxy-cache

soulbird commented on code in PR #9267:
URL: https://github.com/apache/apisix/pull/9267#discussion_r1168214274


##########
t/plugin/body-transformer.t:
##########
@@ -652,3 +652,115 @@ foobar:
             assert(res.status == 200)
         }
     }
+
+
+
+=== TEST 10: cooperation of proxy-cache plugin
+--- http_config
+lua_shared_dict memory_cache 50m;
+--- config
+location /demo {
+    content_by_lua_block {
+        ngx.say([[
+    <SOAP-ENV:Envelope
+        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+    <SOAP-ENV:Header/>
+        <SOAP-ENV:Body>
+            <ns2:CapitalCityResponse
+                xmlns:ns2="http://spring.io/guides/gs-producing-web-service">
+                <ns2:CapitalCityResult>hello</ns2:CapitalCityResult>
+            </ns2:CapitalCityResponse>
+        </SOAP-ENV:Body>
+    </SOAP-ENV:Envelope>
+        ]])
+    }
+}
+
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin")
+
+            local req_template = ngx.encode_base64[[
+                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.oorsprong.org/websamples.countryinfo">
+                <soapenv:Header/>
+                <soapenv:Body>
+                    <web:CapitalCity>
+                    <web:sCountryISOCode>{{_escape_xml(country)}}</web:sCountryISOCode>
+                    </web:CapitalCity>
+                </soapenv:Body>
+                </soapenv:Envelope>
+            ]]
+
+            local rsp_template = ngx.encode_base64[[
+                {"result": {*_escape_json(Envelope.Body.CapitalCityResponse.CapitalCityResult)*}}
+                ]]
+
+            local code, body = t.test('/apisix/admin/routes/1',
+                ngx.HTTP_PUT,
+                string.format([[{
+                    "uri": "/capital",
+                    "plugins": {
+                        "proxy-rewrite": {
+                            "set": {

Review Comment:
   We can set these parameters when making a request, using the proxy-rewrite plugin seems to have nothing to do with the test target



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org