mirror of
https://github.com/pretix/pretix.git
synced 2026-09-13 16:14:40 +00:00
* ESlint: Ignore vendored and pre-vue code * Format pre-vue code with eslint where possible --------- Co-authored-by: Kara Engelhardt <engelhardt@pretix.eu>
22 lines
680 B
JavaScript
22 lines
680 B
JavaScript
let hiddenfield = document.querySelector('input[name=origin][type=hidden]')
|
|
if (hiddenfield) {
|
|
hiddenfield.value = window.location.origin
|
|
}
|
|
async function runCheck () {
|
|
if (document.getElementById('good_origin')) {
|
|
if (document.getElementById('good_origin').innerText.split('').reverse().join('') !== window.location.origin) {
|
|
const _response = await fetch(document.getElementById('bad_origin_report_url').innerText.split('').reverse().join(''), {
|
|
method: 'POST',
|
|
mode: 'cors',
|
|
referrerPolicy: 'unsafe-url',
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
body: 'origin=' + window.location.origin,
|
|
})
|
|
}
|
|
}
|
|
}
|
|
|
|
runCheck()
|