~bigbes/core-go

fea51c61a46ecf190a1734508815f9da6db50be2 — Drew DeVault 1 year, 6 months ago bf509ae
webhooks: add User-Agent to outgoing requests
2 files changed, 2 insertions(+), 0 deletions(-)

M webhooks/legacy.go
M webhooks/queue.go
M webhooks/legacy.go => webhooks/legacy.go +1 -0
@@ 161,6 161,7 @@ func (lq *LegacyQueue) queueStage2(ctx context.Context, tx *sql.Tx,
	deliveryUUID := uuid.New().String()
	headers := make(http.Header)
	headers.Set("Content-Type", "application/json")
	headers.Set("User-Agent", "SourceHut core-go (https://git.sr.ht/~sircmpwn/core-go) webhook queue")
	headers.Set("X-Webhook-Event", event)
	headers.Set("X-Webhook-Delivery", deliveryUUID)
	var sb strings.Builder

M webhooks/queue.go => webhooks/queue.go +1 -0
@@ 171,6 171,7 @@ func (queue *WebhookQueue) queueStage2(ctx context.Context,
	tx *sql.Tx, webhook *WebhookContext) (*work.Task, error) {
	headers := make(http.Header)
	headers.Set("Content-Type", "application/json")
	headers.Set("User-Agent", "SourceHut core-go (https://git.sr.ht/~sircmpwn/core-go) webhook queue")
	headers.Set("X-Webhook-Event", webhook.Event)
	headers.Set("X-Webhook-Delivery", webhook.PayloadUUID.String())