mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-07 06:26:10 -04:00
Every webhook handler (GitHub, GitLab, Gitea, Bitbucket, GitHub App, GitLab App) now reads the fields it uses through typed readers: refs, titles, and actions must be strings, ids positive integers, commit SHAs 7-64 hex characters, and URLs http(s). An invalid value returns "Nothing to do. Invalid '<field>' in the request." without a deployment. Signature checks and the failure lockout are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
448 B
PHP
20 lines
448 B
PHP
<?php
|
|
|
|
namespace App\Exceptions;
|
|
|
|
use Exception;
|
|
|
|
/**
|
|
* A webhook payload field has a wrong type or format.
|
|
*
|
|
* Webhook handlers catch this exception and send a clean "Nothing to do."
|
|
* response. The request does not deploy anything.
|
|
*/
|
|
class InvalidWebhookPayloadException extends Exception
|
|
{
|
|
public static function forField(string $field): self
|
|
{
|
|
return new self("Nothing to do. Invalid '{$field}' in the request.");
|
|
}
|
|
}
|