Skip to content

Commit

Permalink
main: fix return functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hex7c0 committed Sep 9, 2015
1 parent d0878ce commit c5f9ccd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ function wrapper(my) {

var setHeader = require('setheaders').setWritableHeader;

function headers(req, res, next) {
return function headers(req, res, next) {

setHeader(res, header, output);
setHeader(res, header, output); // writable header, check if empty
return next();
}
return headers;
};
}

/**
Expand Down
7 changes: 3 additions & 4 deletions index.min.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"use strict";

function wrapper(my) {
function headers(req, res, next) {
return setHeader(res, header, output), next();
}
var output, header = my.header;
if (my.custom) output = String(my.custom); else {
output = my.signature;
Expand All @@ -18,7 +15,9 @@ function wrapper(my) {
return output;
};
var setHeader = require("setheaders").setWritableHeader;
return headers;
return function(req, res, next) {
return setHeader(res, header, output), next();
};
}

function signature(opt) {
Expand Down

0 comments on commit c5f9ccd

Please sign in to comment.