0

有没有办法将插件配置为仅针对给定方法或一组方法触发?

-routes: 
  - name: some-route
  - paths:
      - /some-path
      plugins:
        - name: some-plugin
          methods: GET # Only run plugin for GET
          configuration:
            some-config:
            - foo
          
4

1 回答 1

2

你应该把方法放在路由级别

-routes: 
  - name: some-route
    methods:
      - GET # Only run plugin for GET
    paths:
      - /some-path
    plugins:
      - name: some-plugin
          
          configuration:
            some-config:
            - foo
          
于 2021-06-16T07:45:51.240 回答