Skip to content

feat: Inform user when call "/plugins/reload" using a wrong HTTP method #9481

@piglei

Description

@piglei

Description

When a user calls the "/apisix/admin/plugins/reload" endpoint to reload the plugins, there is a chance that a wrong HTTP method was used instead of "PUT". In the current implementation, when this happens, for example the endpoint was called via GET method, APISIX will try to find any plugins called "reload", which produces the following response:

{
	"error_msg": "failed to load plugin reload"
}

To improve the experience, we can consider returning a more user-friendly response when the "plugins/reload" is requested using a wrong method. For example, return this instead:

{
	"error_msg": "please use PUT method to reload the plugins, GET method is not allowed."
}

NOTE: This change also makes "reload" a reserved plugin name (wondering if this concept exists in APISIX), because it can never be retrieved via "GET /plugins/".


Related PR: #9482

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions