summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@protonmail.com>2019-06-15 10:08:06 -0500
committerOmar Roth <omarroth@protonmail.com>2019-06-15 10:09:32 -0500
commit552f616305809d111f7540cbea93f89fad3d0760 (patch)
treed078614fb388923ab347c05491de4e34ae10d3f6 /src
parenta3164177f8e7e3d323006e08755230f850a5fdd9 (diff)
downloadinvidious-552f616305809d111f7540cbea93f89fad3d0760.tar.gz
invidious-552f616305809d111f7540cbea93f89fad3d0760.tar.bz2
invidious-552f616305809d111f7540cbea93f89fad3d0760.zip
Fix retry on timeout for AJAX requests
Diffstat (limited to 'src')
-rw-r--r--src/invidious/views/subscription_manager.ecr3
-rw-r--r--src/invidious/views/token_manager.ecr3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/invidious/views/subscription_manager.ecr b/src/invidious/views/subscription_manager.ecr
index fe866bd0..508cf51c 100644
--- a/src/invidious/views/subscription_manager.ecr
+++ b/src/invidious/views/subscription_manager.ecr
@@ -68,7 +68,6 @@ function remove_subscription(target) {
xhr.timeout = 20000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
@@ -78,5 +77,7 @@ function remove_subscription(target) {
}
}
}
+
+ xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
}
</script>
diff --git a/src/invidious/views/token_manager.ecr b/src/invidious/views/token_manager.ecr
index c5cfd7ff..659f5ab3 100644
--- a/src/invidious/views/token_manager.ecr
+++ b/src/invidious/views/token_manager.ecr
@@ -60,7 +60,6 @@ function revoke_token(target) {
xhr.timeout = 20000;
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
@@ -70,5 +69,7 @@ function revoke_token(target) {
}
}
}
+
+ xhr.send('csrf_token=<%= URI.escape(env.get?("csrf_token").try &.as(String) || "") %>');
}
</script>