Skip to content

Commit b3f9987

Browse files
feat(uptime): Add missing User-Agent to example http request (#81180)
1 parent a96c782 commit b3f9987

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

static/app/views/alerts/rules/uptime/httpSnippet.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('HTTPSnippet', function () {
3131
'POST /test?query=value HTTP/1.1',
3232
'Host: example.com',
3333
'X-Something: Header Value',
34+
'User-Agent: SentryUptimeBot/1.0 (+http://docs.sentry.io/product/alerts/uptime-monitoring/',
3435
'Sentry-Trace: sentry-trace-value',
3536
'Content-Size: 18',
3637
``,

static/app/views/alerts/rules/uptime/httpSnippet.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ export function HTTPSnippet({body, headers, method, url, traceSampling}: Props)
3232
: urlObject.pathname;
3333

3434
const appendedBody = body ? `\r\n${body}` : '';
35-
const additionaLheaders = [...headers, ['Sentry-Trace', exampleTrace]];
35+
const additionaLheaders = [
36+
...headers,
37+
[
38+
'User-Agent',
39+
'SentryUptimeBot/1.0 (+http://docs.sentry.io/product/alerts/uptime-monitoring/',
40+
],
41+
['Sentry-Trace', exampleTrace],
42+
];
3643

3744
if (appendedBody !== '') {
3845
additionaLheaders.push(['Content-Size', new Blob([appendedBody]).size.toString()]);

0 commit comments

Comments
 (0)