Match GitHub event headers case-insensitively
Header names arrive lowercase over HTTP/2 (the nginx front end enables it) and Apache preserves that case, so the X-GitHub-Event lookup missed and every email reported "Unknown". Normalise header keys once.
This commit is contained in:
+4
-3
@@ -14,9 +14,10 @@ function githubParse($rawBody, $headers, $metadata) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine event type from headers
|
// Header names arrive lowercase over HTTP/2, so match case-insensitively
|
||||||
$event = $headers['X-GitHub-Event'] ?? $headers['X-Github-Event'] ?? 'Unknown';
|
$headers = array_change_key_case($headers, CASE_LOWER);
|
||||||
$delivery = $headers['X-GitHub-Delivery'] ?? $headers['X-Github-Delivery'] ?? 'Unknown';
|
$event = $headers['x-github-event'] ?? 'Unknown';
|
||||||
|
$delivery = $headers['x-github-delivery'] ?? 'Unknown';
|
||||||
|
|
||||||
// Extract common data
|
// Extract common data
|
||||||
$action = $payload['action'] ?? null;
|
$action = $payload['action'] ?? null;
|
||||||
|
|||||||
Reference in New Issue
Block a user