Skip to content

Commit

Permalink
Fix: accoring to robots.txt spec, sitemap has to be a FQDN
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain committed Nov 24, 2020
1 parent e3439df commit 4aedb82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion truewiki/web_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ async def sitemap_page(request):
@csp_header
async def robots(request):
if sitemap.FRONTEND_URL:
return web.Response(body="User-agent: *\nSitemap: /sitemap.xml", content_type="text/plain")
return web.Response(
body=f"User-agent: *\nSitemap: {sitemap.FRONTEND_URL}/sitemap.xml",
content_type="text/plain",
)
else:
return web.Response(body="User-agent: *", content_type="text/plain")

Expand Down

0 comments on commit 4aedb82

Please sign in to comment.