protected static function extractMetaData(array $headers) {
    $metadata = [];
    foreach($headers as $key => $value) {
      if (StringUtil::startsWith(strtolower($key),
                                 static::METADATA_HEADER_PREFIX)) {
        $metadata_key = substr($key, strlen(static::METADATA_HEADER_PREFIX));
        $metadata[$metadata_key] = $value;
      }
    }

    return $metadata;
  }