Skip to content

Commit cc0c9f7

Browse files
committed
fix: only set Content-Type header when body is present
1 parent 6cd0e1d commit cc0c9f7

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@driftos/client",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "JavaScript SDK for drift-core - conversation routing and context management",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",

src/client.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ export class DriftClient {
2626
const controller = new AbortController();
2727
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
2828

29-
const headers: Record<string, string> = {
30-
'Content-Type': 'application/json',
31-
};
29+
const headers: Record<string, string> = {};
30+
31+
if (body) {
32+
headers['Content-Type'] = 'application/json';
33+
}
3234

3335
if (this.apiKey) {
3436
headers['Authorization'] = `Bearer ${this.apiKey}`;

0 commit comments

Comments
 (0)