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

Merge branch '959-onion-domain-should-be-excluded-from-tld-redirect' into 'development'

Resolve "Onion Domain should be excluded from TLD redirect"

Closes #959

See merge request !1577
parents fffd6bd3 56a6dd57
No related branches found
No related tags found
2 merge requests!1578Development,!1577Resolve "Onion Domain should be excluded from TLD redirect"
...@@ -16,13 +16,14 @@ class LocalizationRedirect ...@@ -16,13 +16,14 @@ class LocalizationRedirect
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
// We only redirect to the TLDs in the production version $locale = LaravelLocalization::getCurrentLocale();
if(env("APP_ENV", "") !== "production"){ $host = $request->getHttpHost();
// We only redirect to the TLDs in the production version and exclude our onion domain
if(env("APP_ENV", "") !== "production" || $host === "b7cxf4dkdsko6ah2.onion"){
return $next($request); return $next($request);
} }
$locale = LaravelLocalization::getCurrentLocale();
$host = $request->getHttpHost();
if($host !== "metager.de" && $locale == "de"){ if($host !== "metager.de" && $locale == "de"){
$url = $request->url(); $url = $request->url();
$url = str_replace($host, "metager.de", $url); $url = str_replace($host, "metager.de", $url);
......
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