Skip to content

Commit 5a32696

Browse files
author
Павел Сериков
committed
K5256 Fixed sentry_version issue and misprint
1 parent 79b256c commit 5a32696

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ inc/
3636

3737

3838
/WWW-Sentry-*
39+
/scripts

lib/WWW/Sentry.pm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,17 @@ my @INTERFACES = (
134134
135135
Constructor
136136
137-
my $sentry = Reg::Sentry->new(
138-
'http://public_key:[email protected]/project-id'
137+
my $sentry = WWW::Sentry->new(
138+
'http://public_key:[email protected]/project-id',
139+
sentry_version => 5 # protocol version can be omitted, 7 by default
139140
);
140141
141142
See also
142143
143144
https://docs.sentry.io/clientdev/overview/#parsing-the-dsn
144145
146+
https://docs.sentry.io/clientdev/overview/#authentication
147+
145148
146149
=cut
147150

@@ -152,6 +155,7 @@ sub new {
152155

153156
my $self = {
154157
ua => LWP::UserAgent->new( timeout => 10 ),
158+
sentry_version => $params{sentry_version} || 7,
155159
%params,
156160
};
157161

@@ -188,7 +192,7 @@ sub _send {
188192
my $response = $self->{ua}->post(
189193
$self->{uri},
190194
'X-Sentry-Auth' => $auth,
191-
'Content-Type' => 'application/octet-stream',
195+
'Content-Type' => 'application/json',
192196
Content => encode_base64( $message ),
193197
);
194198

0 commit comments

Comments
 (0)