mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-30 13:39:57 +00:00
XSRF protection
This commit is contained in:
@@ -47,6 +47,7 @@ function sendToPhone(title, url, selection) {
|
|||||||
var sendUrl = baseUrl + '?title=' + encodeURIComponent(title) +
|
var sendUrl = baseUrl + '?title=' + encodeURIComponent(title) +
|
||||||
'&url=' + encodeURIComponent(url) + '&sel=' + encodeURIComponent(selection);
|
'&url=' + encodeURIComponent(url) + '&sel=' + encodeURIComponent(selection);
|
||||||
req.open('GET', sendUrl, true);
|
req.open('GET', sendUrl, true);
|
||||||
|
req.setRequestHeader('X-Extension', 'true'); // XSRF protector
|
||||||
|
|
||||||
req.onreadystatechange = function() {
|
req.onreadystatechange = function() {
|
||||||
if (this.readyState == 4) {
|
if (this.readyState == 4) {
|
||||||
|
|||||||
Reference in New Issue
Block a user