aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cmd')
-rw-r--r--internal/cmd/hook.go7
-rw-r--r--internal/cmd/web.go3
2 files changed, 6 insertions, 4 deletions
diff --git a/internal/cmd/hook.go b/internal/cmd/hook.go
index 0e9136b0..9b4e2278 100644
--- a/internal/cmd/hook.go
+++ b/internal/cmd/hook.go
@@ -238,9 +238,10 @@ func runHookPostReceive(c *cli.Context) error {
reqURL := fmt.Sprintf("%s%s/%s/tasks/trigger?%s", conf.Server.LocalRootURL, options.RepoUserName, options.RepoName, q.Encode())
log.Trace("Trigger task: %s", reqURL)
- resp, err := httplib.Head(reqURL).SetTLSClientConfig(&tls.Config{
- InsecureSkipVerify: true,
- }).Response()
+ resp, err := httplib.Get(reqURL).
+ SetTLSClientConfig(&tls.Config{
+ InsecureSkipVerify: true,
+ }).Response()
if err == nil {
_ = resp.Body.Close()
if resp.StatusCode/100 != 2 {
diff --git a/internal/cmd/web.go b/internal/cmd/web.go
index 99b8d195..43b9dfc5 100644
--- a/internal/cmd/web.go
+++ b/internal/cmd/web.go
@@ -614,7 +614,6 @@ func runWeb(c *cli.Context) error {
m.Get("", repo.Home)
m.Get("/stars", repo.Stars)
m.Get("/watchers", repo.Watchers)
- m.Head("/tasks/trigger", repo.TriggerTask) // TODO: Without session and CSRF
}, ignSignIn, context.RepoAssignment(), context.RepoRef())
// ***** END: Repository *****
@@ -654,6 +653,8 @@ func runWeb(c *cli.Context) error {
// ***************************
m.Group("/:username/:reponame", func() {
+ m.Get("/tasks/trigger", repo.TriggerTask)
+
m.Group("/info/lfs", func() {
lfs.RegisterRoutes(m.Router)
})