@adobe/helix-html-pipeline 6.10.0 → 6.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/robots-pipe.js +8 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [6.10.1](https://github.com/adobe/helix-html-pipeline/compare/v6.10.0...v6.10.1) (2024-04-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* don't fetch robots.txt from code-bus ([#595](https://github.com/adobe/helix-html-pipeline/issues/595)) ([5000a9c](https://github.com/adobe/helix-html-pipeline/commit/5000a9cdc13fbd12cd479740c60a613c9fcd14e8))
|
|
7
|
+
|
|
1
8
|
# [6.10.0](https://github.com/adobe/helix-html-pipeline/compare/v6.9.0...v6.10.0) (2024-04-24)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/robots-pipe.js
CHANGED
|
@@ -10,10 +10,8 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { cleanupHeaderValue, computeSurrogateKey } from '@adobe/helix-shared-utils';
|
|
13
|
-
import fetchContent from './steps/fetch-content.js';
|
|
14
13
|
import renderCode from './steps/render-code.js';
|
|
15
14
|
import setCustomResponseHeaders from './steps/set-custom-response-headers.js';
|
|
16
|
-
import { PipelineStatusError } from './PipelineStatusError.js';
|
|
17
15
|
import { PipelineResponse } from './PipelineResponse.js';
|
|
18
16
|
import initConfig from './steps/init-config.js';
|
|
19
17
|
|
|
@@ -172,27 +170,15 @@ export async function robotsPipe(state, req) {
|
|
|
172
170
|
try {
|
|
173
171
|
await initConfig(state, req, res);
|
|
174
172
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const robots = state.config?.robots?.txt;
|
|
182
|
-
if (robots) {
|
|
183
|
-
state.content.data = robots;
|
|
184
|
-
} else {
|
|
185
|
-
const ret = generateRobots(state);
|
|
186
|
-
state.content.data = ret.body;
|
|
187
|
-
}
|
|
188
|
-
res.headers.set('content-type', 'text/plain; charset=utf-8');
|
|
189
|
-
res.status = 200;
|
|
190
|
-
delete res.error;
|
|
191
|
-
}
|
|
192
|
-
if (res.error) {
|
|
193
|
-
// if content loading produced an error, we're done.
|
|
194
|
-
throw new PipelineStatusError(res.status, res.error);
|
|
173
|
+
const robots = state.config?.robots?.txt;
|
|
174
|
+
if (robots) {
|
|
175
|
+
state.content.data = robots;
|
|
176
|
+
} else {
|
|
177
|
+
const ret = generateRobots(state);
|
|
178
|
+
state.content.data = ret.body;
|
|
195
179
|
}
|
|
180
|
+
res.headers.set('content-type', 'text/plain; charset=utf-8');
|
|
181
|
+
res.status = 200;
|
|
196
182
|
|
|
197
183
|
state.timer?.update('serialize');
|
|
198
184
|
await renderCode(state, req, res);
|