kayx23 opened a new issue, #9577:
URL: https://github.com/apache/apisix/issues/9577

   ### Description
   
   Open to discussion for room for improvements of the following.
   
   ## Current State
   There are 77  "HTTP" / L7 plugins:
   ```
   curl -s "http://127.0.0.1:9180/apisix/admin/plugins?all=true"; | jq 'length'
   77
   ```
   By default, if `subsystem` is not specified, the response defaults to 
returning L7 plugins. This can be validated with:
   ```
   curl -s "http://127.0.0.1:9180/apisix/admin/plugins?all=true&subsystem=http"; 
| jq 'length'
   77
   ```
   If we want to get stream plugins, we use `subsystem=stream` to query:
   ```
   curl -s 
"http://127.0.0.1:9180/apisix/admin/plugins?all=true&subsystem=stream"; | jq 
'length'
   4
   ```
   
   ## Issue
   
   If you pass other random strings into the `subsystem` query, it still 
defaults to the result for `http`:
   
   ```
   curl "http://127.0.0.1:9180/apisix/admin/plugins?all=true&subsystem=strm"; | 
jq 'length'
   77
   ```
   ```
   curl "http://127.0.0.1:9180/apisix/admin/plugins?all=true&subsystem=htt"; | 
jq 'length'
   77
   ```
   ```
   curl "http://127.0.0.1:9180/apisix/admin/plugins?all=true&subsystem=random"; 
| jq 'length'
   77
   ```
   
   While this may or may not be the intended behaviour, it is not very 
straightforward. I personally think it makes sense to add a checker to see if 
the `subsystem` value is valid (i.e. `http` or `stream`)
   
   ### Environment
   
   APISIX version: 3.3.0


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to