Browse Source

feat: fix attribution link

pull/1105/head
missinglink 7 years ago
parent
commit
1752875f11
  1. 6
      middleware/geocodeJSON.js

6
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, // 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. // and then multiple attributions, can be an object with one key by source.
// Can be a URI on the server, which outlines attribution details. // 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 // OPTIONAL. Default: null. The query that has been issued to trigger the
// search. // search.

Loading…
Cancel
Save