@sveltejs/kit 1.30.0 → 1.30.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/package.json
CHANGED
|
@@ -71,7 +71,19 @@ export async function preview(vite, vite_config, svelte_config) {
|
|
|
71
71
|
|
|
72
72
|
vite.middlewares.use((req, res, next) => {
|
|
73
73
|
const original_url = /** @type {string} */ (req.url);
|
|
74
|
-
const { pathname } = new URL(original_url, 'http://dummy');
|
|
74
|
+
const { pathname, search } = new URL(original_url, 'http://dummy');
|
|
75
|
+
|
|
76
|
+
// if `paths.base === '/a/b/c`, then the root route is `/a/b/c/`,
|
|
77
|
+
// regardless of the `trailingSlash` route option
|
|
78
|
+
if (base.length > 1 && pathname === base) {
|
|
79
|
+
let location = base + '/';
|
|
80
|
+
if (search) location += search;
|
|
81
|
+
res.writeHead(307, {
|
|
82
|
+
location
|
|
83
|
+
});
|
|
84
|
+
res.end();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
75
87
|
|
|
76
88
|
if (pathname.startsWith(base)) {
|
|
77
89
|
next();
|
|
@@ -572,7 +572,12 @@ export function create_client(app, target) {
|
|
|
572
572
|
server: server_data_node,
|
|
573
573
|
universal: node.universal?.load ? { type: 'data', data, uses } : null,
|
|
574
574
|
data: data ?? server_data_node?.data ?? null,
|
|
575
|
-
|
|
575
|
+
// if `paths.base === '/a/b/c`, then the root route is `/a/b/c/`,
|
|
576
|
+
// regardless of the `trailingSlash` route option
|
|
577
|
+
slash:
|
|
578
|
+
url.pathname === base || url.pathname === base + '/'
|
|
579
|
+
? 'always'
|
|
580
|
+
: node.universal?.trailingSlash ?? server_data_node?.slash
|
|
576
581
|
};
|
|
577
582
|
}
|
|
578
583
|
|
|
@@ -216,7 +216,7 @@ async function call_action(event, actions) {
|
|
|
216
216
|
|
|
217
217
|
const action = actions[name];
|
|
218
218
|
if (!action) {
|
|
219
|
-
throw
|
|
219
|
+
throw error(404, `No action with name '${name}' found`);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
if (!is_form_content_type(event.request)) {
|
package/src/version.js
CHANGED