Do not send branch information as http header.

This commit is contained in:
Michael Peick 2019-10-26 13:34:16 +02:00
parent 9ecc67fb3a
commit 1eb223e2cc
2 changed files with 4 additions and 8 deletions

View File

@ -302,7 +302,7 @@ func main() {
time.Sleep(waitTime(*flWait))
continue
} else if changed {
err := triggerWebhook(ctx, webhookTriggerChan, *flBranch, *flRev, *flRoot)
err := triggerWebhook(ctx, webhookTriggerChan, *flRev, *flRoot)
if err != nil {
log.Error(err, "triggering webhook failed")
}
@ -692,10 +692,8 @@ func setupGitCookieFile() error {
return nil
}
func triggerWebhook(ctx context.Context, ch chan webhookRepoInfo, branch, rev, gitRoot string) error {
info := webhookRepoInfo{
Branch: branch,
}
func triggerWebhook(ctx context.Context, ch chan webhookRepoInfo, rev, gitRoot string) error {
info := webhookRepoInfo{}
hash, err := hashForRev(ctx, rev, gitRoot)
if err != nil {

View File

@ -23,13 +23,11 @@ type Webhook struct {
}
type webhookRepoInfo struct {
Hash string
Branch string
Hash string
}
func (w *Webhook) Do(info webhookRepoInfo) error {
req, err := http.NewRequest(w.Method, w.URL, nil)
req.Header.Set("Git-Sync-Branch", info.Branch)
req.Header.Set("Git-Sync-Hash", info.Hash)
if err != nil {
return err