Skip to content

Commit

Permalink
fix: default to application/json when not provided deepgram/audio+vid…
Browse files Browse the repository at this point in the history
…eo content-type (#181)
  • Loading branch information
lukeocodes authored Oct 20, 2023
1 parent 5785006 commit 05f8210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/packages/AbstractRestfulClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ export class AbstractRestfulClient {
return params;
}

params.headers = { ...options?.headers };
params.headers = { "Content-Type": "application/json", ...options?.headers };
params.body = body;

return { ...params, ...parameters, duplex: "half" };
}

Expand Down
4 changes: 0 additions & 4 deletions src/packages/PrerecordedClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export class PrerecordedClient extends AbstractRestfulClient {
endpoint = "v1/listen"
): Promise<DeepgramResponse<SyncPrerecordedResponse>> {
try {
this.headers["Content-Type"] = "application/json";

let body;

if (isUrlSource(source)) {
Expand Down Expand Up @@ -102,8 +100,6 @@ export class PrerecordedClient extends AbstractRestfulClient {
endpoint = "v1/listen"
): Promise<DeepgramResponse<AsyncPrerecordedResponse>> {
try {
this.headers["Content-Type"] = "application/json";

let body;

if (isUrlSource(source)) {
Expand Down

0 comments on commit 05f8210

Please sign in to comment.