Skip to content

missing headers in status webhook #33244

Closed
@JonasB2497

Description

@JonasB2497

Description

I am using Gitea in combination with Jenkins and the Gitea Plugin for Jenkins.
Using a webhook for all events in the gitea organization and and organization folder on the Jenkins side.

The new status webhook (#27151) introduced in 1.23.0 has the X-GitHub-Event, X-Gitea-Event and X-Gogs-Event headers missing/empty:

Request URL: http://jenkins:8080/gitea-webhook/post
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: e862f2f7-cf9e-4903-8f95-5c67f51ac3bc
X-GitHub-Event: 
X-GitHub-Event-Type: status
X-Gitea-Delivery: e862f2f7-cf9e-4903-8f95-5c67f51ac3bc
X-Gitea-Event: 
X-Gitea-Event-Type: status
X-Gitea-Signature: 
X-Gogs-Delivery: e862f2f7-cf9e-4903-8f95-5c67f51ac3bc
X-Gogs-Event: 
X-Gogs-Event-Type: status
X-Gogs-Signature: 
X-Hub-Signature: sha1=
X-Hub-Signature-256: sha256=

In comparison a webhook for a push event:

Request URL: http://jenkins:8080/gitea-webhook/post
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: b0ced20b-1aaf-4f8d-9529-ad00ebd9210d
X-GitHub-Event: push
X-GitHub-Event-Type: push
X-Gitea-Delivery: b0ced20b-1aaf-4f8d-9529-ad00ebd9210d
X-Gitea-Event: push
X-Gitea-Event-Type: push
X-Gitea-Signature: 
X-Gogs-Delivery: b0ced20b-1aaf-4f8d-9529-ad00ebd9210d
X-Gogs-Event: push
X-Gogs-Event-Type: push
X-Gogs-Signature: 
X-Hub-Signature: sha1=
X-Hub-Signature-256: sha256=

Because of this the Jenkins plugin returns an error code with the log message:

java.lang.Exception: Expecting a Gitea event, missing expected X-Gitea-Event header

I think this should be ultimately be made more robust in the plugin but is probably a bug here as well.

Gitea Version

1.23.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.47.1

Operating System

Debian 12

How are you running Gitea?

using gitea/gitea:latest docker image

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions