mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 05:08:28 +02:00
fix(plugin-auth): check both endpoint and method
This commit is contained in:
@@ -84,7 +84,7 @@ func (m *APIKeyManager) ValidateAPIKeyForEndpoint(endpoint string, method string
|
|||||||
|
|
||||||
// Check if the endpoint is permitted
|
// Check if the endpoint is permitted
|
||||||
for _, permittedEndpoint := range pluginAPIKey.PermittedEndpoints {
|
for _, permittedEndpoint := range pluginAPIKey.PermittedEndpoints {
|
||||||
if permittedEndpoint.Endpoint == endpoint {
|
if permittedEndpoint.Endpoint == endpoint && permittedEndpoint.Method == method {
|
||||||
return pluginAPIKey, nil
|
return pluginAPIKey, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user