mirror of
https://github.com/typemill/typemill.git
synced 2025-07-31 11:20:15 +02:00
Fix proxy detection and force base url
This commit is contained in:
@@ -196,16 +196,16 @@ class ControllerWebSystem extends Controller
|
||||
{
|
||||
$licensefields[$key]['disabled'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
# check license data
|
||||
$licensecheck = $license->checkLicense($licensedata, $this->c->get('urlinfo'));
|
||||
if(!$licensecheck)
|
||||
{
|
||||
$message = $license->getMessage();
|
||||
}
|
||||
# check license data
|
||||
$licensecheck = $license->checkLicense($licensedata, $this->c->get('urlinfo'));
|
||||
if(!$licensecheck)
|
||||
{
|
||||
$message = $license->getMessage();
|
||||
}
|
||||
|
||||
unset($licensedata['signature']);
|
||||
unset($licensedata['signature']);
|
||||
}
|
||||
|
||||
return $this->c->get('view')->render($response, 'system/license.twig', [
|
||||
'settings' => $this->settings,
|
||||
|
@@ -69,7 +69,7 @@ class Urlinfo
|
||||
private static function removeStandardPorts($uri)
|
||||
{
|
||||
$port = $uri->getPort();
|
||||
if ($port == 80 || $port == 443)
|
||||
if (!$port || $port == 80 || $port == 443)
|
||||
{
|
||||
$uri = $uri->withPort(null);
|
||||
}
|
||||
|
@@ -239,6 +239,9 @@ fieldsetdeveloper:
|
||||
trustedproxies:
|
||||
type: text
|
||||
label: "Trusted IPs for proxies (comma separated)"
|
||||
fqdn:
|
||||
type: text
|
||||
label: "If your proxy does not work, try to add the base-url of your proxy here like https://mywebsite.com."
|
||||
headersoff:
|
||||
type: checkbox
|
||||
label: "Disable Custom Headers"
|
||||
|
@@ -119,6 +119,21 @@ $app->setBasePath($basepath);
|
||||
|
||||
$uriFactory = new UriFactory();
|
||||
$uri = $uriFactory->createFromGlobals($_SERVER);
|
||||
|
||||
if(
|
||||
isset($settings['proxy']) &&
|
||||
$settings['proxy'] &&
|
||||
isset($_SERVER['HTTP_X_FORWARDED_HOST']) &&
|
||||
isset($settings['fqdn']) &&
|
||||
$settings['fqdn'] != ''
|
||||
)
|
||||
{
|
||||
$fqdn = $uriFactory->createUri($settings['fqdn']);
|
||||
$uri = $uri->withScheme($fqdn->getScheme())
|
||||
->withHost($fqdn->getHost())
|
||||
->withPort($fqdn->getPort());
|
||||
}
|
||||
|
||||
$urlinfo = Urlinfo::getUrlInfo($basepath, $uri, $settings);
|
||||
|
||||
$timer['settings'] = microtime(true);
|
||||
|
Reference in New Issue
Block a user