Commit 7e86165d authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

solved caching problem

parent 6bb885f1
......@@ -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
......@@ -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()->addMinutes(30));
], now()->addSeconds(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
]
);
}
}
......
<?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
@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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment