Something went wrong on our end
-
Dominik Hebeler authoredDominik Hebeler authored
web.php 1.51 KiB
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::post('/{url}', function ($url) {
abort(405);
});
Route::get('healthz', function () {
return response('', 200)
->header('Content-Type', 'text/plain');
});
Route::get('/', function () {
if (env("APP_ENV", "") !== "production") {
return view("development");
} else {
return redirect("https://metager.de");
}
});
Route::get('index.css', 'BrowserVerification@verifyCss');
Route::post('/', function (Request $request) {
$validatedData = $request->validate([
'url' => 'required|url|max:255',
]);
$url = $request->input('url', 'https://metager.de');
$password = md5(env('PROXY_PASSWORD') . $url);
$url = base64_encode(str_rot13($url));
$target = urlencode(str_replace("/", "<<SLASH>>", $url));
return redirect(action('ProxyController@proxyPage', ['password' => $password, 'url' => $target]));
});
Route::get('{password}/{url}', 'ProxyController@proxyPage')->middleware('throttle:60:1')->middleware('checkpw');
Route::get('proxy/{password}/{url}', 'ProxyController@proxy')->middleware('browserverification')->middleware('checkpw:true');