Fix windows test and deprecated redirect method usage.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
Co-authored-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Eric Peterson
2022-06-13 17:46:01 +02:00
parent 429c9f9daa
commit 2c048f8b90
3 changed files with 8 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-node': patch
---
Updated deprecated use of `express`' `res.redirect()` method when handling legacy path casing.
@@ -24,6 +24,7 @@ import request from 'supertest';
import mockFs from 'mock-fs';
import * as os from 'os';
import { LocalPublish } from './local';
import path from 'path';
const createMockEntity = (annotations = {}, lowerCase = false) => {
return {
@@ -145,7 +146,7 @@ describe('local publisher', () => {
...{
kind: 'component',
metadata: {
name: '../component/other-component',
name: path.join('..', 'component', 'other-component'),
namespace: 'default',
},
},
@@ -220,7 +220,7 @@ export class LocalPublish implements PublisherBase {
}
// Otherwise, redirect to the new path.
return res.redirect(req.baseUrl + newPath, 301);
return res.redirect(301, req.baseUrl + newPath);
});
router.use(