From 1752875f11a529d1c6cea5f7613b97c01bb65806 Mon Sep 17 00:00:00 2001 From: missinglink Date: Thu, 22 Mar 2018 15:23:56 +0100 Subject: [PATCH] feat: fix attribution link --- middleware/geocodeJSON.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/middleware/geocodeJSON.js b/middleware/geocodeJSON.js index 683feac4..0ff2e303 100644 --- a/middleware/geocodeJSON.js +++ b/middleware/geocodeJSON.js @@ -47,7 +47,11 @@ function convertToGeocodeJSON(req, res, next, opts) { // OPTIONAL. Default: null. The attribution of the data. In case of multiple sources, // and then multiple attributions, can be an object with one key by source. // Can be a URI on the server, which outlines attribution details. - res.body.geocoding.attribution = url.resolve(opts.config.host, opts.basePath + 'attribution'); + res.body.geocoding.attribution = url.format({ + protocol: req.protocol, + host: req.get('host'), + pathname: opts.basePath + 'attribution' + }); // OPTIONAL. Default: null. The query that has been issued to trigger the // search.