Permalink
Browse files

Save changes

  • Loading branch information...
vaheqelyan
vaheqelyan committed Jan 11, 2019
1 parent 0f90801 commit 037113dc1054465f871fba342fb2ec9671488d9e
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/browser/post.js
@@ -5,12 +5,9 @@ export default async function post(chunks, ...interpolations) {
const { headers, pureUrl } = parseHeaders(url);

let postData = interpolations[interpolations.length - 1];

if (typeof postData === "object") {
if (!headers["Content-Type"]) {
postData = JSON.stringify(postData);
headers["Content-Type"] = "application/json";
}
postData = JSON.stringify(postData);
headers["Content-Type"] = "application/json";
}

const startFetch = await fetch(pureUrl, {

0 comments on commit 037113d

Please sign in to comment.