Skip to content

Commit

Permalink
Fix Missing HTTP Content Type not sending body text
Browse files Browse the repository at this point in the history
  • Loading branch information
LordTocs committed Oct 6, 2023
1 parent b93971a commit bd80d9c
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions packages/castmate/src/main/plugins/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,25 @@ export default {
await template(data.body || "", context),
])

const resp = await axios.request({
url: addr,
method: data.method,
body,
})
if (
data.method == "POST" ||
data.method == "PUT" ||
data.method == "PATCH"
) {
await axios.request({
url: addr,
method: data.method,
headers: {
"Content-type": "text/plain",
},
data: body,
})
} else {
await axios.request({
url: addr,
method: data.method,
})
}
},
},
},
Expand Down

0 comments on commit bd80d9c

Please sign in to comment.