Repository navigation
fix: preserve message body responses as text #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -109,7 +109,7 @@ export default class MessagesApi { | |
| public async getTextMessage(sandboxId: number, messageId: number) { | ||
| const url = `${this.messagesURL}/${sandboxId}/messages/${messageId}/body.txt`; | ||
|
|
||
| return this.client.get<string, string>(url); | ||
| return this.client.get<string, string>(url, { responseType: "text" }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Text readers can return parsed values under Axios 0.27.x. The declared The repository lockfile resolves Axios 1.20.0, which skips forced parsing when Override the response transform for these readers with an identity transform. Alternatively, disable forced JSON parsing for each request. Add coverage that runs against the oldest supported Axios version in the declared range.
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -118,7 +118,7 @@ export default class MessagesApi { | |
| public async getRawMessage(sandboxId: number, messageId: number) { | ||
| const url = `${this.messagesURL}/${sandboxId}/messages/${messageId}/body.raw`; | ||
|
|
||
| return this.client.get<string, string>(url); | ||
| return this.client.get<string, string>(url, { responseType: "text" }); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -127,7 +127,7 @@ export default class MessagesApi { | |
| public async getMessageHtmlSource(sandboxId: number, messageId: number) { | ||
| const url = `${this.messagesURL}/${sandboxId}/messages/${messageId}/body.htmlsource`; | ||
|
|
||
| return this.client.get<string, string>(url); | ||
| return this.client.get<string, string>(url, { responseType: "text" }); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -136,7 +136,7 @@ export default class MessagesApi { | |
| public async getHtmlMessage(sandboxId: number, messageId: number) { | ||
| const url = `${this.messagesURL}/${sandboxId}/messages/${messageId}/body.html`; | ||
|
|
||
| return this.client.get<string, string>(url); | ||
| return this.client.get<string, string>(url, { responseType: "text" }); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -145,7 +145,7 @@ export default class MessagesApi { | |
| public async getMessageAsEml(sandboxId: number, messageId: number) { | ||
| const url = `${this.messagesURL}/${sandboxId}/messages/${messageId}/body.eml`; | ||
|
|
||
| return this.client.get<string, string>(url); | ||
| return this.client.get<string, string>(url, { responseType: "text" }); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.