mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-30 14:53:01 +00:00
Update epub.js
send the CSRF token when adding bookmarks
This commit is contained in:
@@ -61,11 +61,14 @@ var reader;
|
|||||||
this.removeBookmark(bookmark);
|
this.removeBookmark(bookmark);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var csrftoken = $("input[name='csrf_token']").val();
|
||||||
|
|
||||||
// Save to database
|
// Save to database
|
||||||
$.ajax(calibre.bookmarkUrl, {
|
$.ajax(calibre.bookmarkUrl, {
|
||||||
method: "post",
|
method: "post",
|
||||||
data: { bookmark: location || "" }
|
data: { bookmark: location || "" },
|
||||||
|
headers: { "X-CSRFToken": csrftoken }
|
||||||
}).fail(function (xhr, status, error) {
|
}).fail(function (xhr, status, error) {
|
||||||
alert(error);
|
alert(error);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user