Skip to content

Commit 51cd950

Browse files
authored
Add a robots.txt for forklift (#17796)
* Add a robots.txt for forklift * Update tests
1 parent 071ee72 commit 51cd950

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

tests/unit/forklift/test_init.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ def test_includeme(forklift_domain, monkeypatch):
7272
route_kw={"domain": forklift_domain},
7373
view_kw={"has_translations": True},
7474
),
75+
pretend.call(
76+
"forklift.robots.txt",
77+
"/robots.txt",
78+
"forklift.robots.txt",
79+
route_kw={"domain": forklift_domain},
80+
view_kw={"has_translations": False},
81+
),
7582
pretend.call(
7683
"forklift.legacy.invalid_request",
7784
"/legacy/",

warehouse/forklift/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def includeme(config):
7171
view_kw={"has_translations": True},
7272
)
7373

74+
config.add_template_view(
75+
"forklift.robots.txt",
76+
"/robots.txt",
77+
"forklift.robots.txt",
78+
route_kw={"domain": forklift},
79+
view_kw={"has_translations": False},
80+
)
81+
7482
# Any call to /legacy/ not handled by another route (e.g. no :action
7583
# URL parameter, or an invalid :action URL parameter) falls through to
7684
# this catch-all route.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow: /

0 commit comments

Comments
 (0)