Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
deichman
Commits
a984125f
Commit
a984125f
authored
Jun 17, 2021
by
Torstein Nicolaysen
Committed by
Torstein
Jun 22, 2021
Browse files
DEICH-5952
disallow scraping in non-prod environments
parent
a6ef37e5
Changes
1
Show whitespace changes
Inline
Side-by-side
deichman.no/server.js
View file @
a984125f
...
...
@@ -181,7 +181,12 @@ app
// Allow crawling all content
server
.
use
(
"
/robots.txt
"
,
(
req
,
res
)
=>
{
res
.
type
(
"
text/plain
"
);
res
.
send
(
"
User-agent: *
\n
Disallow:
"
);
if
(
dev
)
{
res
.
send
(
"
User-agent: *
\n
Disallow: /
"
);
// Disallow everything
}
else
{
res
.
send
(
"
User-agent: *
\n
Disallow:
"
);
// Allow everything
}
});
// Check for redirects
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment