Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.common.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Hoppscotch Browser Extension",
"version": "0.37",
"version": "0.38",
"description": "Provides more capabilities for Hoppscotch",
"icons": {
"16": "icons/icon-16x16.png",
Expand Down
10 changes: 10 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ async function fetchUsingAxiosConfig(
} catch (_) {}
}

try {
const contentType = axiosConfig.headers["content-type"] || "";

if (contentType.includes("application/json") && axiosConfig.data && typeof axiosConfig.data !== "string") {
axiosConfig.data = JSON.stringify(axiosConfig.data);
}
} catch (e) {
console.error("Error stringifying axiosConfig.data:", e, axiosConfig.data);
}

// TODO: check different examples with axios body
const res = await fetch(axiosConfig.url, {
headers: {
Expand Down