Merge remote-tracking branch 'bookmark_csrf/master'

This commit is contained in:
Ozzie Isaacs
2021-12-14 17:59:32 +01:00
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -61,11 +61,14 @@ var reader;
this.removeBookmark(bookmark);
}.bind(this));
}
var csrftoken = $("input[name='csrf_token']").val();
// Save to database
$.ajax(calibre.bookmarkUrl, {
method: "post",
data: { bookmark: location || "" }
data: { bookmark: location || "" },
headers: { "X-CSRFToken": csrftoken }
}).fail(function (xhr, status, error) {
alert(error);
});