Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Set custom Content-Type #132

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions packages/json-routes/json-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ JsonRoutes.setResponseHeaders = function (headers) {
JsonRoutes.sendResult = function (res, options) {
options = options || {};

// We've already set global headers on response, but if they
// pass in more here, we set those.
if (options.headers) setHeaders(res, options.headers);

// Set status code on response
res.statusCode = options.code || 200;

// Set response body
writeJsonToBody(res, options.data);

// We've already set global headers on response, but if they
// pass in more here, we set those.
if (options.headers) setHeaders(res, options.headers);

// Send the response
res.end();
};
Expand Down