Skip to content

Commit d64c9bc

Browse files
stainless-app[bot]meorphis
authored andcommitted
fix: send correct Accept header for certain endpoints (#2317)
1 parent 503ff6b commit d64c9bc

File tree

10 files changed

+14
-6
lines changed

10 files changed

+14
-6
lines changed

src/resources/addressing/loa-documents.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class LOADocuments extends APIResource {
3232
const { account_id } = params;
3333
return this._client.get(`/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, {
3434
...options,
35+
headers: { Accept: 'application/pdf', ...options?.headers },
3536
__binaryResponse: true,
3637
});
3738
}

src/resources/images/v1/blobs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class Blobs extends APIResource {
1313
const { account_id } = params;
1414
return this._client.get(`/accounts/${account_id}/images/v1/${imageId}/blob`, {
1515
...options,
16+
headers: { Accept: 'image/*', ...options?.headers },
1617
__binaryResponse: true,
1718
});
1819
}

src/resources/kv/namespaces/values.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ export class Values extends APIResource {
7070
const { account_id } = params;
7171
return this._client.get(
7272
`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`,
73-
{ ...options, __binaryResponse: true },
73+
{
74+
...options,
75+
headers: { Accept: 'application/octet-stream', ...options?.headers },
76+
__binaryResponse: true,
77+
},
7478
);
7579
}
7680
}

src/resources/magic-transit/pcaps/download.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class Download extends APIResource {
1212
const { account_id } = params;
1313
return this._client.get(`/accounts/${account_id}/pcaps/${pcapId}/download`, {
1414
...options,
15+
headers: { Accept: 'application/vnd.tcpdump.pcap', ...options?.headers },
1516
__binaryResponse: true,
1617
});
1718
}

src/resources/snippets/content.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class Content extends APIResource {
1616
const { zone_id } = params;
1717
return this._client.get(`/zones/${zone_id}/snippets/${snippetName}/content`, {
1818
...options,
19+
headers: { Accept: 'multipart/form-data', ...options?.headers },
1920
__binaryResponse: true,
2021
});
2122
}

src/resources/stream/embed.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ export class Embed extends APIResource {
1111
*/
1212
get(identifier: string, params: EmbedGetParams, options?: Core.RequestOptions): Core.APIPromise<string> {
1313
const { account_id } = params;
14-
return this._client.get(`/accounts/${account_id}/stream/${identifier}/embed`, {
15-
...options,
16-
headers: { Accept: 'application/json', ...options?.headers },
17-
});
14+
return this._client.get(`/accounts/${account_id}/stream/${identifier}/embed`, options);
1815
}
1916
}
2017

src/resources/url-scanner/scans.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export class Scans extends APIResource {
9999
return this._client.get(`/accounts/${account_id}/urlscanner/v2/screenshots/${scanId}.png`, {
100100
query,
101101
...options,
102+
headers: { Accept: 'image/png', ...options?.headers },
102103
__binaryResponse: true,
103104
});
104105
}

src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class Content extends APIResource {
5353
const { account_id } = params;
5454
return this._client.get(
5555
`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/content`,
56-
{ ...options, __binaryResponse: true },
56+
{ ...options, headers: { Accept: 'string', ...options?.headers }, __binaryResponse: true },
5757
);
5858
}
5959
}

src/resources/workers/scripts/content.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export class Content extends APIResource {
5050
const { account_id } = params;
5151
return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/content/v2`, {
5252
...options,
53+
headers: { Accept: 'string', ...options?.headers },
5354
__binaryResponse: true,
5455
});
5556
}

src/resources/zero-trust/dex/commands/downloads.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class Downloads extends APIResource {
1717
const { account_id } = params;
1818
return this._client.get(`/accounts/${account_id}/dex/commands/${commandId}/downloads/${filename}`, {
1919
...options,
20+
headers: { Accept: 'application/zip', ...options?.headers },
2021
__binaryResponse: true,
2122
});
2223
}

0 commit comments

Comments
 (0)