Skip to content

Commit 171cd15

Browse files
authored
add keep alive option to fetch standard transport (#787)
1 parent 0de4a54 commit 171cd15

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@segment/analytics-next': minor
3+
---
4+
5+
Add keep-alive header to fetch for standard transport.

packages/browser/src/plugins/segmentio/fetch-dispatcher.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type Dispatcher = (url: string, body: object) => Promise<unknown>
55
export default function (): { dispatch: Dispatcher } {
66
function dispatch(url: string, body: object): Promise<unknown> {
77
return fetch(url, {
8+
keepalive: true,
89
headers: { 'Content-Type': 'text/plain' },
910
method: 'post',
1011
body: JSON.stringify(body),

0 commit comments

Comments
 (0)