@@ -834,6 +834,12 @@ spec:
834834 secretKeyRef:
835835 name: control-plane-secret
836836 key: admin-key
837+ plugins:
838+ - name: response-rewrite
839+ enabled: true
840+ config:
841+ headers:
842+ X-Proxy-Test: "enabled"
837843`
838844 const ingressClassSpec = `
839845apiVersion: networking.k8s.io/v1
@@ -898,6 +904,10 @@ spec:
898904 Expect ().Raw ().StatusCode
899905 }).WithTimeout (8 * time .Second ).ProbeEvery (time .Second ).
900906 Should (Equal (http .StatusOK ))
907+ s .NewAPISIXClient ().
908+ GET ("/get" ).
909+ WithHost ("ingress.example.com" ).
910+ Expect ().Header ("X-Proxy-Test" ).IsEqual ("enabled" )
901911
902912 By ("create additional gateway group to get new admin key" )
903913 additionalGatewayGroupID , _ , err = s .CreateAdditionalGatewayGroup ("gateway-proxy-update" )
@@ -928,6 +938,13 @@ spec:
928938 Expect ().Raw ().StatusCode
929939 }).WithTimeout (8 * time .Second ).ProbeEvery (time .Second ).
930940 Should (Equal (http .StatusOK ))
941+ Eventually (func () string {
942+ return client .
943+ GET ("/get" ).
944+ WithHost ("ingress.example.com" ).
945+ Expect ().Raw ().Header .Get ("X-Proxy-Test" )
946+ }).WithTimeout (8 * time .Second ).ProbeEvery (time .Second ).
947+ Should (Equal ("enabled" ))
931948 })
932949 })
933950})
0 commit comments