Language: PHP
Label: safe
CWE: CWE-770 \u2014 Allocation of Resources Without Limits or Throttling
The product allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor.

Code:
	public function __construct()
	{
		$this->headers = getallheaders();

		// set header for the response
		header("Accept: application/json");
		header("Content-Type: application/json");

		// check whether API interface is enabled after all
		if (Settings::Get('api.enabled') != 1) {
			throw new Exception('API is not enabled. Please contact the administrator if you think this is wrong.', 400);
		}

		RateLimiter::run();
	}