Skip to content

Commit

Permalink
Update robots view to disallow non-canonical (#6433)
Browse files Browse the repository at this point in the history
* Update robots view to disallow non-canonical

* Use get_host
  • Loading branch information
smithellis authored Jan 14, 2025
1 parent 93693d3 commit 56bcd07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kitsune/sumo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ def robots(request):
if not settings.ENGAGE_ROBOTS:
template = "User-Agent: *\nDisallow: /"
else:
template = render(request, "sumo/robots.html")
if request.get_host() != "support.mozilla.org":
# We will differentiate this for tests with a comment
template = "# Non-canoncial\nUser-Agent: *\nDisallow: /"
else:
template = render(request, "sumo/robots.html")

return HttpResponse(template, content_type="text/plain")


Expand Down

0 comments on commit 56bcd07

Please sign in to comment.