Skip to content
Snippets Groups Projects
Commit 90b2daf8 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

generating URLs only working in non production environment

parent f2c6fcf9
No related branches found
No related tags found
1 merge request!22Resolve "Increase readability of Proxy URLs"
This commit is part of merge request !22. Comments created here will be created in the context of that merge request.
......@@ -27,14 +27,15 @@ Route::get('/', 'ProxyController@proxyPage')->name('proxy-wrapper-page');
Route::get('p', 'ProxyController@proxy')->name('proxy');
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]));
if (env("APP_ENV", "") !== "production") {
$validatedData = $request->validate([
'url' => 'required|url|max:255',
]);
$url = $request->input('url', 'https://metager.de');
return redirect(\App\Http\Controllers\ProxyController::generateProxyWrapperUrl($url));
}else{
abort(400);
}
});
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment