Skip to content

Commit

Permalink
Make export form send authenticity token
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 2, 2017
1 parent 9a82ae0 commit 9363148
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/assets/javascripts/leaflet.share.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ L.OSM.share = function (options) {
.attr('type', 'hidden')
.appendTo($form);

var csrf_param = $("meta[name=csrf-param]").attr("content"),
csrf_token = $("meta[name=csrf-token]").attr("content");

$('<input>')
.attr('name', csrf_param)
.attr('value', csrf_token)
.attr('type', 'hidden')
.appendTo($form);

$('<p>')
.attr('class', 'deemphasize')
.html(I18n.t('javascripts.share.image_size') + ' <span id="mapnik_image_width"></span> x <span id="mapnik_image_height"></span>')
Expand Down

0 comments on commit 9363148

Please sign in to comment.