0

I want to use Wikimedia Maps to display maps on my Ruby on Rails 5.2 application (I'm using Leaflet for this), but the Terms of Use for Wikimedia Maps demands:

"...you must provide a valid HTTP User-Agent that includes your application, version, and sufficient information to easily contact you (e.g., your email address)."

How can I include an email address to each HTTP request in Rails?

Fernando
  • 325
  • 2
  • 13
  • Could you add the specific request you use to get the map to your question? – ldeld Dec 17 '18 at 10:36
  • `https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png?lang=eo` – Fernando Dec 17 '18 at 19:19
  • 1
    If it is a web application (your users use a web browser to view your app) and your Ruby on Rails application does not proxy your app user's requests, you most likely are unable to modify the header information because tt boils down to this: https://stackoverflow.com/questions/27000152/set-custom-header-for-the-request-made-from-img-tag I suggest a simple proxy server that also caches the responses from Wikimedia for a reasonable time so you do not get blocked for exhausting their resources. – Rainer Rillke Jan 09 '19 at 22:48
  • For setting up a proxy, c.f. to e.g. https://serverfault.com/a/391615/326675 and with cache: https://www.nginx.com/resources/wiki/start/topics/examples/reverseproxycachingexample/ or https://serverfault.com/questions/30705/how-to-set-up-nginx-as-a-caching-reverse-proxy – Rainer Rillke Jan 09 '19 at 22:58

0 Answers0