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
7e86165d
Commit
7e86165d
authored
Jan 06, 2023
by
Dominik Hebeler
Browse files
solved caching problem
parent
6bb885f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
metager/app/Http/Controllers/HumanVerification.php
View file @
7e86165d
...
...
@@ -317,7 +317,7 @@ class HumanVerification extends Controller
Cache
::
lock
(
$key
.
"_lock"
,
10
)
->
block
(
5
,
function
()
use
(
$key
)
{
$bvData
=
Cache
::
get
(
$key
);
if
(
$bvData
===
null
)
{
$bvData
=
[]
;
abort
(
404
)
;
}
if
(
\
array_key_exists
(
"css"
,
$bvData
))
{
$bvData
[
"css"
]
=
array
();
...
...
@@ -342,7 +342,7 @@ class HumanVerification extends Controller
Cache
::
lock
(
$key
.
"_lock"
,
10
)
->
block
(
5
,
function
()
use
(
$key
,
$request
)
{
$bvData
=
Cache
::
get
(
$key
);
if
(
$bvData
===
null
)
{
$bvData
=
[]
;
abort
(
404
)
;
}
if
(
!
\
array_key_exists
(
"js"
,
$bvData
))
{
$bvData
[
"js"
]
=
array
();
...
...
@@ -379,7 +379,7 @@ class HumanVerification extends Controller
Cache
::
lock
(
$mgv
.
"_lock"
,
10
)
->
block
(
5
,
function
()
use
(
$mgv
,
$request
)
{
$bvData
=
Cache
::
get
(
$mgv
);
if
(
$bvData
===
null
)
{
$bvData
=
[]
;
abort
(
404
)
;
}
$report
=
$request
->
getContent
();
...
...
@@ -427,5 +427,6 @@ class HumanVerification extends Controller
Cache
::
put
(
$mgv
,
$bvData
,
now
()
->
addMinutes
(
self
::
BV_DATA_EXPIRATION_MINUTES
));
});
return
response
(
""
,
200
);
}
}
\ No newline at end of file
metager/app/Http/Middleware/BrowserVerification.php
View file @
7e86165d
...
...
@@ -78,7 +78,8 @@ class BrowserVerification
}
if
(
$framed
)
{
self
::
logBrowserverification
(
$request
);
abort
(
429
);
$params
=
$request
->
except
([
"mgv"
,
"iframe"
]);
return
response
(
view
(
"errors/410"
,
[
"refresh"
=>
route
(
$route
,
$params
)]));
}
else
{
$params
=
$request
->
all
();
unset
(
$params
[
"mgv"
]);
...
...
@@ -138,7 +139,7 @@ class BrowserVerification
"tries"
=>
[
now
()
]
],
now
()
->
add
Minute
s
(
30
));
],
now
()
->
add
Second
s
(
30
));
$report_to
=
route
(
"csp_verification"
,
[
"mgv"
=>
$key
]);
$params
=
$request
->
all
();
$params
[
"mgv"
]
=
$key
;
...
...
@@ -149,7 +150,12 @@ class BrowserVerification
return
response
(
view
(
'layouts.resultpage.framedResultPage'
,
[
"frame_url"
=>
$frame_url
,
"js_url"
=>
$js_url
,
"mgv"
=>
$key
]),
200
,
[
"Content-Security-Policy"
=>
"default-src 'self'; script-src 'self' 'nonce-
$key
'; script-src-elem 'self' 'nonce-
$key
'; script-src-attr 'self'; style-src 'self' 'nonce-
$key
'; style-src-elem 'self' 'nonce-
$key
'; style-src-attr 'self' 'nonce-
$key
'; img-src 'self' data:; font-src 'self'; connect-src 'self'; frame-src 'self'; frame-ancestors 'self' https://scripts.zdv.uni-mainz.de; form-action 'self' www.paypal.com; report-uri "
.
$report_to
.
"; report_to "
.
$report_to
]
[
"Cache-Control"
=>
"no-cache, no-store, must-revalidate"
,
"Pragma"
=>
"no-cache"
,
"Expires"
=>
"0"
,
"Content-Security-Policy"
=>
"default-src 'self'; script-src 'self' 'nonce-
$key
'; script-src-elem 'self' 'nonce-
$key
'; script-src-attr 'self'; style-src 'self' 'nonce-
$key
'; style-src-elem 'self' 'nonce-
$key
'; style-src-attr 'self' 'nonce-
$key
'; img-src 'self' data:; font-src 'self'; connect-src 'self'; frame-src 'self'; frame-ancestors 'self' https://scripts.zdv.uni-mainz.de; form-action 'self' www.paypal.com; report-uri "
.
$report_to
.
"; report_to "
.
$report_to
]
);
}
}
...
...
metager/lang/de/410.php
0 → 100644
View file @
7e86165d
<?php
return
[
"title"
=>
"Bitte laden Sie die Ergebnisseite neu"
,
"text"
=>
"Sie haben einen veralteten Link verwendet. Bitte laden Sie die Seite neu"
];
\ No newline at end of file
metager/resources/views/errors/410.blade.php
0 → 100644
View file @
7e86165d
@
extends
(
'layouts.subPages'
)
@
section
(
'title'
,
'Fehler 410 - Resultpage Expired'
)
@
section
(
'content'
)
<
style
>
main
#main-content {
align
-
items
:
center
;
justify
-
content
:
center
;
}
</
style
>
<
h1
>
{{
trans
(
'410.title'
)
}}
</
h1
>
<
p
>
{{
trans
(
'410.text'
)
}}
</
p
>
<
div
>
<
a
href
=
"{{
$refresh
}}"
target
=
"_top"
>
Ergebnisseite
neu
laden
</
a
>
</
div
>
@
endsection
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