You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/22 08:56:27 UTC

[GitHub] [apisix-ingress-controller] Chever-John commented on a diff in pull request #976: feat: improve the e2e test of referer-restriction plugin

Chever-John commented on code in PR #976:
URL: https://github.com/apache/apisix-ingress-controller/pull/976#discussion_r855948083


##########
test/e2e/suite-plugins/referer-restriction.go:
##########
@@ -101,6 +101,125 @@ spec:
 		resp.Body().Contains("Your referer host is not allowed")
 	})
 
+	ginkgo.It("referer-restriction plugin configuration blacklist list", func() {
+		backendSvc, backendPorts := s.DefaultHTTPBackend()
+		ar := fmt.Sprintf(`
+apiVersion: apisix.apache.org/v2beta3
+kind: ApisixRoute
+metadata:
+ name: httpbin-route
+spec:
+ http:
+ - name: rule1
+   match:
+     hosts:
+     - httpbin.org
+     paths:
+       - /ip
+   backends:
+   - serviceName: %s
+     servicePort: %d
+     weight: 10
+   plugins:
+   - name: referer-restriction
+     enable: true
+     config:
+       blacklist:
+         - test.com
+         - "*.foo.com"
+`, backendSvc, backendPorts[0])
+
+		assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ar))
+
+		err := s.EnsureNumApisixUpstreamsCreated(1)
+		assert.Nil(ginkgo.GinkgoT(), err, "Checking number of upstreams")

Review Comment:
   Sure~



-- 
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