Browse Source

feat(attribution): allow overriding attribution URL

This url is used to show attribution information for Pelias data sources

It was often not detected correctly if, for example, the API is proxied
behind a load balancer.
pull/1149/head
Julian Simioni 6 years ago
parent
commit
7122317f2a
No known key found for this signature in database
GPG Key ID: B9EEB0C6EE0910A1
  1. 2
      middleware/geocodeJSON.js

2
middleware/geocodeJSON.js

@ -47,7 +47,7 @@ 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.format({
res.body.geocoding.attribution = opts.config.attributionURL || url.format({
protocol: req.protocol,
host: req.get('host'),
pathname: opts.basePath + 'attribution'

Loading…
Cancel
Save