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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user