Comparing version 0.0.13 to 0.0.14
@@ -21,4 +21,5 @@ var mongoose = require('mongoose'); | ||
var protocol = req.headers['x-forwarded-proto'] || req.protocol; | ||
var uri = req.headers['x-forwarded-uri'] || req.originalUrl; | ||
return protocol + '://' + req.headers.host + req.originalUrl; | ||
return protocol + '://' + req.headers.host + uri; | ||
} | ||
@@ -25,0 +26,0 @@ |
@@ -43,4 +43,5 @@ var mongoose = require('mongoose'); | ||
var protocol = req.headers['x-forwarded-proto'] || req.protocol; | ||
var uri = req.headers['x-forwarded-uri'] || req.originalUrl; | ||
return protocol + '://' + req.headers.host + req.originalUrl + '/' + doc._id + '/_history/' + doc._version; | ||
return protocol + '://' + req.headers.host + uri + '/' + doc._id + '/_history/' + doc._version; | ||
}; | ||
@@ -53,8 +54,9 @@ | ||
var protocol = req.headers['x-forwarded-proto'] || req.protocol; | ||
var uri = req.headers['x-forwarded-uri'] || req.originalUrl; | ||
if (req.originalUrl.indexOf('/_history/') < 0) { | ||
return protocol + '://' + req.headers.host + req.originalUrl + '/_history/' + doc._version; | ||
if (uri.indexOf('/_history/') < 0) { | ||
return protocol + '://' + req.headers.host + uri + '/_history/' + doc._version; | ||
} | ||
else { | ||
return protocol + '://' + req.headers.host + req.originalUrl; | ||
return protocol + '://' + req.headers.host + uri; | ||
} | ||
@@ -61,0 +63,0 @@ }; |
@@ -26,3 +26,5 @@ //polyfill String.contains | ||
var protocol = req.headers['x-forwarded-proto'] || req.protocol; | ||
return protocol + '://' + req.headers.host + req.originalUrl.split('?')[0]; | ||
var uri = req.headers['x-forwarded-uri'] || req.originalUrl; | ||
return protocol + '://' + req.headers.host + uri.split('?')[0]; | ||
} | ||
@@ -29,0 +31,0 @@ |
{ | ||
"name": "fhirball", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "An Express router for a nodejs+MongoDB FHIR server", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
2769519
8766