mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-02-10 18:05:07 +08:00
Add error handler to api robots.txt
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ node_modules
|
|||||||
/Gruntfile.js.out
|
/Gruntfile.js.out
|
||||||
local-development-*.json
|
local-development-*.json
|
||||||
*.pyc
|
*.pyc
|
||||||
|
run-develop-local.py
|
||||||
@ -245,8 +245,13 @@ docsCoServer.install(server, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.get('/robots.txt', (req, res) => {
|
app.get('/robots.txt', (req, res) => {
|
||||||
res.setHeader('Content-Type', 'plain/text');
|
try {
|
||||||
res.send("User-agent: *\nDisallow: /");
|
res.setHeader('Content-Type', 'plain/text');
|
||||||
|
res.send("User-agent: *\nDisallow: /");
|
||||||
|
} catch (err) {
|
||||||
|
ctx.logger.error('robots.txt: %s', err.stack);
|
||||||
|
res.json({ message: 'Error Occured' });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/docbuilder', utils.checkClientIp, rawFileParser, (req, res) => {
|
app.post('/docbuilder', utils.checkClientIp, rawFileParser, (req, res) => {
|
||||||
|
|||||||
5423
npm-shrinkwrap.json
generated
5423
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user