Skip to content

Commit

Permalink
chore: update symfony config for https
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-chinour committed Apr 4, 2024
1 parent 9c23883 commit 1b427fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions config/packages/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
*/
$framework
->secret('%env(APP_SECRET)%')
->trustedHeaders([
'x-forwarded-for',
'x-forwarded-host',
'x-forwarded-proto',
'x-forwarded-port',
'x-forwarded-prefix',
])
->httpMethodOverride(false)
->handleAllThrowables(true)
->test($container->env() === 'test')
Expand Down Expand Up @@ -137,8 +144,7 @@
->limiter('public')
->policy('sliding_window')
->limit(1000)
->interval('60 minutes')
;
->interval('60 minutes');

/**
* Lock Configuration
Expand Down
4 changes: 4 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
return function (ContainerConfigurator $container): void {
$services = $container->services();

$container->parameters()
->set('router.request_context.scheme', 'https')
->set('asset.request_context.secure', true);

/**
* Sets default configuration for services
*/
Expand Down
4 changes: 2 additions & 2 deletions templates/pages/sitemap.xml.twig
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for page in ['home', 'project_list', 'article_list'] %}
<url><loc>{{ absolute_url(path(page)) }}</loc></url>
<url><loc>{{ url(page) }}</loc></url>
{% endfor %}

{% for article in articles %}
<url><loc>{{ absolute_url(path('article_view', {'slug': article.slug})) }}</loc></url>
<url><loc>{{ url('article_view', {'slug': article.slug}) }}</loc></url>
{% endfor %}
</urlset>

0 comments on commit 1b427fd

Please sign in to comment.