mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-24 11:13:47 +00:00
fix: url validation in webhook add/edit API (#7932)
Cherry-pick from 972381097c
(see #7909).
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7932
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Antonin Delpeuch <antonin@delpeuch.eu>
Co-committed-by: Antonin Delpeuch <antonin@delpeuch.eu>
This commit is contained in:
parent
b2a3966e64
commit
2b30c83a0c
3 changed files with 116 additions and 0 deletions
21
routers/api/v1/utils/main_test.go
Normal file
21
routers/api/v1/utils/main_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"forgejo.org/models/unittest"
|
||||
"forgejo.org/modules/setting"
|
||||
webhook_service "forgejo.org/services/webhook"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
unittest.MainTest(m, &unittest.TestOptions{
|
||||
SetUp: func() error {
|
||||
setting.LoadQueueSettings()
|
||||
return webhook_service.Init()
|
||||
},
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue