luyadev / luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.
https://luya.io
MIT License
812 stars 207 forks source link

Optional URL configuration to ensure serverName #1762

Closed nadar closed 6 years ago

nadar commented 6 years ago

A configuration option which ensures the serverName is equal the given serverName.

if ($_SERVER['server_name'] !== 'mydomain') { exit; }

This could encounter a potential security issue when the server is configured with dns wildcard.

The composition component could have a new option which is used when a value is set

'composition' => [
   'allowedHosts' => ['example.com', 'dev.example.com', 'anotherdomain.com', '*.wildcard.com'],
   // or as string
   'allowedHosts' => 'example.com',
],