From 62ce22064c5c82831d12d6695647444340c01031 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 26 May 2015 12:02:50 +0200 Subject: [PATCH 1/2] Use the reserved domains example.com and example.org --- contributing/documentation/standards.rst | 3 +++ reference/configuration/framework.rst | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/contributing/documentation/standards.rst b/contributing/documentation/standards.rst index 3210ee65927..84b1ee98d42 100644 --- a/contributing/documentation/standards.rst +++ b/contributing/documentation/standards.rst @@ -57,6 +57,8 @@ Code Examples Unless the example requires a custom bundle, make sure to always use the ``AppBundle`` bundle to store your code; * Use ``Acme`` when the code requires a vendor name; +* Use ``example.com`` as the domain of sample URLs and ``example.org`` when a + second domain is required. Both domains are `reserved by the IANA`_. * To avoid horizontal scrolling on code blocks, we prefer to break a line correctly if it crosses the 85th character; * When you fold one or more lines of code, place ``...`` in a comment at the point @@ -174,6 +176,7 @@ In addition, documentation follows these rules: .. _`the Sphinx documentation`: http://sphinx-doc.org/rest.html#source-code .. _`Twig Coding Standards`: http://twig.sensiolabs.org/doc/coding_standards.html +.. _`reserved by the IANA`: http://www.iana.org/domains/reserved .. _`American English`: http://en.wikipedia.org/wiki/American_English .. _`American English Oxford Dictionary`: http://www.oxforddictionaries.com/definition/american_english/ .. _`headings and titles`: http://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 2aa107344a4..4a011dd388e 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -283,7 +283,7 @@ respond and the user will receive a 500 response. # app/config/config.yml framework: - trusted_hosts: ['acme.com', 'acme.org'] + trusted_hosts: ['example.com', 'example.org'] .. code-block:: xml @@ -296,8 +296,8 @@ respond and the user will receive a 500 response. http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - acme.com - acme.org + example.com + example.org @@ -306,17 +306,17 @@ respond and the user will receive a 500 response. // app/config/config.php $container->loadFromExtension('framework', array( - 'trusted_hosts' => array('acme.com', 'acme.org'), + 'trusted_hosts' => array('example.com', 'example.org'), )); -Hosts can also be configured using regular expressions (e.g. ``.*\.?acme.com$``), +Hosts can also be configured using regular expressions (e.g. ``.*\.?example.com$``), which make it easier to respond to any subdomain. In addition, you can also set the trusted hosts in the front controller using the ``Request::setTrustedHosts()`` method:: // web/app.php - Request::setTrustedHosts(array('.*\.?acme.com$', '.*\.?acme.org$')); + Request::setTrustedHosts(array('.*\.?example.com$', '.*\.?example.org$')); The default value for this option is an empty array, meaning that the application can respond to any given host. From 3931faf1232dabaa428b27b21686cd99c1d7c635 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 26 May 2015 12:33:22 +0200 Subject: [PATCH 2/2] Updated the list of reserved domains and the URL reference --- contributing/documentation/standards.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contributing/documentation/standards.rst b/contributing/documentation/standards.rst index 84b1ee98d42..8aa289c36da 100644 --- a/contributing/documentation/standards.rst +++ b/contributing/documentation/standards.rst @@ -57,8 +57,9 @@ Code Examples Unless the example requires a custom bundle, make sure to always use the ``AppBundle`` bundle to store your code; * Use ``Acme`` when the code requires a vendor name; -* Use ``example.com`` as the domain of sample URLs and ``example.org`` when a - second domain is required. Both domains are `reserved by the IANA`_. +* Use ``example.com`` as the domain of sample URLs and ``example.org`` and + ``example.net`` when additional domains are required. All of these domains are + `reserved by the IANA`_. * To avoid horizontal scrolling on code blocks, we prefer to break a line correctly if it crosses the 85th character; * When you fold one or more lines of code, place ``...`` in a comment at the point @@ -176,7 +177,7 @@ In addition, documentation follows these rules: .. _`the Sphinx documentation`: http://sphinx-doc.org/rest.html#source-code .. _`Twig Coding Standards`: http://twig.sensiolabs.org/doc/coding_standards.html -.. _`reserved by the IANA`: http://www.iana.org/domains/reserved +.. _`reserved by the IANA`: http://tools.ietf.org/html/rfc2606#section-3 .. _`American English`: http://en.wikipedia.org/wiki/American_English .. _`American English Oxford Dictionary`: http://www.oxforddictionaries.com/definition/american_english/ .. _`headings and titles`: http://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles