Skip to content

Commit

Permalink
Merge pull request #4 from tmaindron/tmaindron-work
Browse files Browse the repository at this point in the history
Tmaindron work
  • Loading branch information
evantahler committed Apr 12, 2012
2 parents 9e0bf79 + 68dd733 commit 1db23ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@ log/*
cache/*
node_modules/*
.DS_Store
npm-debug.log
npm-debug.log
/nbproject/*
3 changes: 3 additions & 0 deletions config.json
Expand Up @@ -6,6 +6,9 @@
"socketServerWelcomeMessage" : "Hello! Welcome to the actionHero api",
"apiBaseDir" : "./node_modules/actionHero/",

"httpHeaders" : {
},

"secureWebServer" : {
"port": 4443,
"enable": false,
Expand Down
9 changes: 8 additions & 1 deletion initializers/initWebServer.js
Expand Up @@ -39,8 +39,15 @@ var initWebServer = function(api, next)
connection.remoteIP = connection.req.connection.remoteAddress;
connection.responseHeaders = {
'Content-Type': "application/json",
"X-Powered-By": api.configData.serverName,
"X-Powered-By": api.configData.serverName
};

if(typeof(api.configData.httpHeaders) != 'undefined'){
for(var i in api.configData.httpHeaders){
connection.responseHeaders[i] = api.configData.httpHeaders[i];
}
}

connection.responseHttpCode = 200;
if(connection.req.headers['x-forwarded-for'] != null)
{
Expand Down

0 comments on commit 1db23ff

Please sign in to comment.