forked from rDrama/rDrama
send xhr header so errors don't give back HTML pages
parent
b1924e0cdf
commit
9be721dcf4
|
@ -188,6 +188,7 @@ const emojisSearchDictionary = {
|
|||
// get public emojis list
|
||||
const emojiRequest = new XMLHttpRequest();
|
||||
emojiRequest.open("GET", '/marsey_list.json');
|
||||
emojiRequest.setRequestHeader('xhr', 'xhr');
|
||||
emojiRequest.onload = async (e) => {
|
||||
console.log("HERE")
|
||||
let emojis = JSON.parse(emojiRequest.response);
|
||||
|
|
|
@ -147,6 +147,7 @@ function autoSuggestTitle() {
|
|||
}
|
||||
}
|
||||
x.open('get','/submit/title?url=' + urlField.value);
|
||||
x.setRequestHeader('xhr', 'xhr');
|
||||
x.send(null);
|
||||
|
||||
};
|
||||
|
|
|
@ -131,6 +131,7 @@
|
|||
const game = document.getElementById('casino-game-wrapper').dataset.game;
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("get", `/casino/${game}/feed`);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
xhr.onload = handleFeedResponse.bind(null, xhr);
|
||||
xhr.send();
|
||||
}
|
||||
|
|
|
@ -324,6 +324,7 @@
|
|||
if (confirmed) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("post", "/casino/roulette/place-bet");
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
xhr.onload = handleRouletteResponse.bind(null, xhr);
|
||||
|
||||
const form = new FormData();
|
||||
|
@ -354,6 +355,7 @@
|
|||
function requestRouletteBets() {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("get", "/casino/roulette/bets");
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
xhr.onload = handleRouletteResponse.bind(null, xhr);
|
||||
xhr.send();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("post", "/casino/slots");
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
xhr.onload = handleSlotsResponse.bind(null, xhr);
|
||||
|
||||
const form = new FormData();
|
||||
|
|
|
@ -210,6 +210,7 @@
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.withCredentials=true;
|
||||
xhr.open("POST", '/dismiss_mobile_tip', true);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
xhr.send();
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue