diff --git a/index.js b/index.js index 4a71a6f..4d2ace0 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,9 @@ function wellKnownJSON (options, resources) { var m = req.path.match(WELL_KNOWN) var base = options.baseUri || - (req.headers['x-forwarded-proto'] || req.protocol) + + (options.forceProtocol || + req.headers['x-forwarded-proto'] || + req.protocol) + '://' + (req.headers['x-forwarded-host'] || req.headers.host) diff --git a/package.json b/package.json index 69df0c5..97768ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oada/well-known-json", - "version": "1.0.0", + "version": "1.0.1", "description": "Middleware for JSON Well-Known resources", "main": "index.js", "scripts": {