Some information beforehand:
I have 1 servers with 2 domains, one is the live version (live), the other is for testing purposes (redesign). I'm using GitHub webhooks to automatically update my redesign server with the repository so that when there's multiple people working on the repo, we don't have to manually deploy it every time.
Now, I have found a PHP script (This is exactly how I use it apart from the secret) on GitHub in which the webhook is being parsed returns an error saying that the Content-Type
header is missing, while when I look in the webhook delivery it clearly has the header.
The error presents itself on line 33 of the PHP script which checks if the HTTP_CONTENT_TYPE
is present by checking
if (!isset($_SERVER['HTTP_CONTENT_TYPE'])) {
throw new \Exception("Missing HTTP 'Content-Type' header.");
}
To ask an actual question: How can the PHP if throw the exception when the header is clearly present?