From 0204951e51f6f07d3eb19301b9dee247820a8920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Re=C3=A9?= Date: Thu, 9 Jan 2025 12:01:07 +0100 Subject: [PATCH] Fix robots.txt in devmode (#6571) --- packages/volto/news/6572.bugfix | 1 + packages/volto/src/helpers/Robots/Robots.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 packages/volto/news/6572.bugfix diff --git a/packages/volto/news/6572.bugfix b/packages/volto/news/6572.bugfix new file mode 100644 index 0000000000..dd0a329794 --- /dev/null +++ b/packages/volto/news/6572.bugfix @@ -0,0 +1 @@ +Fix robots.txt in devmode @reebalazs \ No newline at end of file diff --git a/packages/volto/src/helpers/Robots/Robots.js b/packages/volto/src/helpers/Robots/Robots.js index bc0f2bd620..b2299ab2ba 100644 --- a/packages/volto/src/helpers/Robots/Robots.js +++ b/packages/volto/src/helpers/Robots/Robots.js @@ -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');