mirror of
https://github.com/Monibuca/plugin-hook.git
synced 2025-12-24 10:40:51 +08:00
🐛 FIX: 修复没有配置导致初始化nil错误
This commit is contained in:
6
main.go
6
main.go
@@ -43,6 +43,12 @@ var plugin = InstallPlugin(&HookConfig{
|
||||
func (h *HookConfig) OnEvent(event any) {
|
||||
switch v := event.(type) {
|
||||
case FirstConfig:
|
||||
if h.RequestList == nil {
|
||||
h.RequestList = make(map[string]*HookAddr)
|
||||
}
|
||||
if h.URLList == nil {
|
||||
h.URLList = make(map[string]string)
|
||||
}
|
||||
if h.BaseURL != "" {
|
||||
for k, u := range h.URLList {
|
||||
if !strings.HasSuffix(u, "http") {
|
||||
|
||||
Reference in New Issue
Block a user