Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Send client version in User-Agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Sep 4, 2012
1 parent bb03f16 commit fc9589f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Raven/Client.php
Expand Up @@ -17,6 +17,8 @@


class Raven_Client class Raven_Client
{ {
const VERSION = '0.1.0';

const DEBUG = 10; const DEBUG = 10;
const INFO = 20; const INFO = 20;
const WARN = 30; const WARN = 30;
Expand Down Expand Up @@ -251,13 +253,15 @@ public function send($data)
$message = base64_encode(gzcompress(Raven_Compat::json_encode($data))); $message = base64_encode(gzcompress(Raven_Compat::json_encode($data)));


foreach($this->servers as $url) { foreach($this->servers as $url) {
$client_string = 'raven-php/' . self::VERSION;
$timestamp = microtime(true); $timestamp = microtime(true);
$signature = $this->get_signature( $signature = $this->get_signature(
$message, $timestamp, $this->secret_key); $message, $timestamp, $this->secret_key);


$headers = array( $headers = array(
'User-Agent' => $client_string,
'X-Sentry-Auth' => $this->get_auth_header( 'X-Sentry-Auth' => $this->get_auth_header(
$signature, $timestamp, 'raven-php/0.1', $this->public_key), $signature, $timestamp, $client_string, $this->public_key),
'Content-Type' => 'application/octet-stream' 'Content-Type' => 'application/octet-stream'
); );


Expand Down

0 comments on commit fc9589f

Please sign in to comment.