Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GitHub.php

function GitHub::isRateLimited

Finds whether a request failed due to rate limiting

Parameters

string[] $headers Headers from Composer\Downloader\TransportException.:

File

vendor/composer/composer/src/Composer/Util/GitHub.php, line 208

Class

GitHub
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Util

Code

public function isRateLimited(array $headers) : bool {
    foreach ($headers as $header) {
        if (Preg::isMatch('{^x-ratelimit-remaining: *0$}i', trim($header))) {
            return true;
        }
    }
    return false;
}
RSS feed
Powered by Drupal