Skip to content

Commit ffd0415

Browse files
authored
Merge pull request #27767 from backstage/patch-release-pr-27751
Patch release of #27751
2 parents a2a93c3 + fe7f896 commit ffd0415

File tree

9 files changed

+50
-27
lines changed

9 files changed

+50
-27
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "root",
3-
"version": "1.33.3",
3+
"version": "1.33.4",
44
"private": true,
55
"repository": {
66
"type": "git",

packages/backend-legacy/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# example-backend-legacy
22

3+
## 0.2.107
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @backstage/plugin-app-backend@0.4.2
9+
310
## 0.2.106
411

512
### Patch Changes

packages/backend-legacy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-backend-legacy",
3-
"version": "0.2.106",
3+
"version": "0.2.107",
44
"backstage": {
55
"role": "backend"
66
},

packages/backend/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# example-backend
22

3+
## 0.0.35
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @backstage/plugin-app-backend@0.4.2
9+
310
## 0.0.34
411

512
### Patch Changes

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-backend",
3-
"version": "0.0.34",
3+
"version": "0.0.35",
44
"backstage": {
55
"role": "backend"
66
},

plugins/app-backend/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @backstage/plugin-app-backend
22

3+
## 0.4.2
4+
5+
### Patch Changes
6+
7+
- 087c675: Fix root route handling when query parameters are present
8+
39
## 0.4.1
410

511
### Patch Changes

plugins/app-backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@backstage/plugin-app-backend",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "A Backstage backend plugin that serves the Backstage frontend app",
55
"backstage": {
66
"role": "backend-plugin",

plugins/app-backend/src/service/appPlugin.test.ts

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,37 @@ describe('appPlugin', () => {
9393
],
9494
});
9595

96-
const rootContent = await fetch(`http://localhost:${server.port()}`).then(
97-
res => res.text(),
98-
);
99-
100-
expect(rootContent).toBe(`<html><head>
96+
const baseUrl = `http://localhost:${server.port()}`;
97+
const withInjectedConfig = `<html><head>
10198
<script type="backstage.io/config">
10299
[]
103100
</script>
104-
</head></html>`);
101+
</head></html>`;
105102

106-
const indexContent = await fetch(
107-
`http://localhost:${server.port()}/index.html`,
108-
).then(res => res.text());
103+
await expect(fetch(`${baseUrl}`).then(res => res.text())).resolves.toBe(
104+
withInjectedConfig,
105+
);
109106

110-
expect(indexContent).toBe(`<html><head>
111-
<script type="backstage.io/config">
112-
[]
113-
</script>
114-
</head></html>`);
107+
await expect(
108+
fetch(`${baseUrl}?foo=bar`).then(res => res.text()),
109+
).resolves.toBe(withInjectedConfig);
115110

116-
const htmlContent = await fetch(
117-
`http://localhost:${server.port()}/api/app/some/html5/route`,
118-
).then(res => res.text());
111+
await expect(
112+
fetch(`${baseUrl}/index.html`).then(res => res.text()),
113+
).resolves.toBe(withInjectedConfig);
119114

120-
expect(htmlContent).toBe(`<html><head>
121-
<script type="backstage.io/config">
122-
[]
123-
</script>
124-
</head></html>`);
115+
await expect(
116+
fetch(`${baseUrl}/index.html?foo=bar`).then(res => res.text()),
117+
).resolves.toBe(withInjectedConfig);
118+
119+
await expect(
120+
fetch(`${baseUrl}/api/app/some/html5/route`).then(res => res.text()),
121+
).resolves.toBe(withInjectedConfig);
122+
123+
await expect(
124+
fetch(`${baseUrl}/api/app/some/html5/route?foo=bar`).then(res =>
125+
res.text(),
126+
),
127+
).resolves.toBe(withInjectedConfig);
125128
});
126129
});

plugins/app-backend/src/service/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ async function createEntryPointRouter({
306306
const rootRouter = Router();
307307
rootRouter.use((req, _res, next) => {
308308
// Make sure / and /index.html are handled by the HTML5 route below
309-
if (req.url === '/' || req.url === '/index.html') {
309+
if (req.path === '/' || req.path === '/index.html') {
310310
next('router');
311311
} else {
312312
next();

0 commit comments

Comments
 (0)