Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
57d0b9e8
Commit
57d0b9e8
authored
Jan 20, 2023
by
Dominik Hebeler
Browse files
do not follow redirects
parent
3249bb88
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
metager/resources/js/admin/count.js
View file @
57d0b9e8
...
...
@@ -137,7 +137,8 @@ function loadTotals(parallel) {
if
(
fetches
.
length
<
parallel
)
{
fetches
.
push
(
fetch
(
"
/admin/count/count-data-total?date=
"
+
date
+
"
&interface=
"
+
lang
"
/admin/count/count-data-total?date=
"
+
date
+
"
&interface=
"
+
lang
,
{
redirect
:
"
error
"
}
)
.
then
((
response
)
=>
{
if
(
response
.
status
===
302
)
{
...
...
@@ -155,10 +156,8 @@ function loadTotals(parallel) {
data
[
days_ago
][
"
total
"
]
=
total_requests
;
})
.
catch
((
reason
)
=>
{
if
(
!
data
[
days_ago
])
{
data
[
days_ago
]
=
{};
}
data
[
days_ago
][
"
total
"
]
=
0
;
// We are not logged in anymore
history
.
go
();
})
);
}
else
{
...
...
@@ -181,7 +180,8 @@ function loadSameTimes(parallel) {
if
(
fetches
.
length
<
parallel
)
{
fetches
.
push
(
fetch
(
"
/admin/count/count-data-until?date=
"
+
date
+
"
&interface=
"
+
lang
"
/admin/count/count-data-until?date=
"
+
date
+
"
&interface=
"
+
lang
,
{
redirect
:
"
error
"
}
)
.
then
((
response
)
=>
{
if
(
response
.
status
===
302
)
{
...
...
metager/resources/js/admin/spam.js
View file @
57d0b9e8
...
...
@@ -39,15 +39,8 @@ function loadQueries() {
let
url
=
base_url
+
"
?since=
"
+
encodeURI
(
latest_update
);
fetch
(
url
)
.
then
((
response
)
=>
{
if
(
response
.
status
===
302
)
{
// We are not logged in anymore
history
.
go
();
}
else
{
return
response
.
json
();
}
})
fetch
(
url
,
{
redirect
:
"
error
"
})
.
then
((
response
)
=>
response
.
json
())
.
then
((
data
)
=>
{
let
latest
=
data
.
latest
;
document
.
getElementById
(
"
queries
"
).
dataset
.
latest
=
latest
;
...
...
@@ -101,6 +94,10 @@ function loadQueries() {
}
checkRegexp
();
})
.
catch
((
reason
)
=>
{
// We are not logged in anymore
history
.
go
();
});
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment