Skip to content

Commit

Permalink
Fix robots.txt in devmode (#6571)
Browse files Browse the repository at this point in the history
  • Loading branch information
reebalazs authored Jan 9, 2025
1 parent e55b4a6 commit 0204951
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/volto/news/6572.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix robots.txt in devmode @reebalazs
4 changes: 3 additions & 1 deletion packages/volto/src/helpers/Robots/Robots.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import { addHeadersFactory } from '@plone/volto/helpers/Proxy/Proxy';
export const generateRobots = (req) =>
new Promise((resolve) => {
const internalUrl =
config.settings.internalApiPath ?? config.settings.apiPath;
config.settings.internalApiPath ??
config.settings.devProxyToApiPath ??
config.settings.apiPath;
const request = superagent.get(`${internalUrl}/robots.txt`);
request.set('Accept', 'text/plain');
const authToken = req.universalCookies.get('auth_token');
Expand Down

0 comments on commit 0204951

Please sign in to comment.