API: Verify inheritance from BeEF::API class (#2803)

This commit is contained in:
bcoles
2023-04-03 23:22:38 +10:00
committed by GitHub
parent 0742b5aef4
commit 4a4eb307bc

View File

@@ -184,7 +184,7 @@ module BeEF
mods = get_owners(clss, mthd, args)
return nil unless mods.length.positive?
unless verify_api_path(clss, mthd) && clss.ancestors[0].to_s > 'BeEF::API'
unless verify_api_path(clss, mthd) && clss.ancestors.first.to_s.start_with?('BeEF::API')
print_error "API Path not defined for Class: #{clss} method: #{mthd}"
return []
end