Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Merge branch 'chentsulin-use-end-to-send-data'
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Aug 13, 2016
2 parents ae441fc + 3d5ed8a commit e01eb2e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.js
Expand Up @@ -241,14 +241,12 @@ export default function graphqlHTTP(options: Options): Middleware {
operationName, result
});
response.setHeader('Content-Type', 'text/html; charset=utf-8');
response.write(data);
response.end();
response.end(data);
} else {
// Otherwise, present JSON directly.
const data = JSON.stringify(result, null, pretty ? 2 : 0);
response.setHeader('Content-Type', 'application/json; charset=utf-8');
response.write(data);
response.end();
response.end(data);
}
});
};
Expand Down

0 comments on commit e01eb2e

Please sign in to comment.