@sveltejs/kit 1.0.0-next.515 → 1.0.0-next.516

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.515",
3
+ "version": "1.0.0-next.516",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -354,7 +354,7 @@ function get_methods(cwd, output, manifest_data) {
354
354
  const lookup = {};
355
355
  output.forEach((chunk) => {
356
356
  if (!chunk.facadeModuleId) return;
357
- const id = chunk.facadeModuleId.slice(cwd.length + 1);
357
+ const id = posixify(path.relative(cwd, chunk.facadeModuleId));
358
358
  lookup[id] = chunk.exports;
359
359
  });
360
360
 
@@ -1310,12 +1310,20 @@ export function create_client({ target, base, trailing_slash }) {
1310
1310
 
1311
1311
  const is_svg_a_element = a instanceof SVGAElement;
1312
1312
 
1313
- // Ignore non-HTTP URL protocols (e.g. `mailto:`, `tel:`, `myapp:`, etc.)
1313
+ // Ignore URL protocols that differ to the current one and are not http(s) (e.g. `mailto:`, `tel:`, `myapp:`, etc.)
1314
+ // This may be wrong when the protocol is x: and the link goes to y:.. which should be treated as an external
1315
+ // navigation, but it's not clear how to handle that case and it's not likely to come up in practice.
1314
1316
  // MEMO: Without this condition, firefox will open mailer twice.
1315
1317
  // See:
1316
1318
  // - https://github.com/sveltejs/kit/issues/4045
1317
1319
  // - https://github.com/sveltejs/kit/issues/5725
1318
- if (!is_svg_a_element && !(url.protocol === 'https:' || url.protocol === 'http:')) return;
1320
+ // - https://github.com/sveltejs/kit/issues/6496
1321
+ if (
1322
+ !is_svg_a_element &&
1323
+ url.protocol !== location.protocol &&
1324
+ !(url.protocol === 'https:' || url.protocol === 'http:')
1325
+ )
1326
+ return;
1319
1327
 
1320
1328
  // Ignore if tag has
1321
1329
  // 1. 'download' attribute
@@ -327,8 +327,15 @@ export async function respond(request, options, state) {
327
327
  if (if_none_match_value === etag) {
328
328
  const headers = new Headers({ etag });
329
329
 
330
- // https://datatracker.ietf.org/doc/html/rfc7232#section-4.1
331
- for (const key of ['cache-control', 'content-location', 'date', 'expires', 'vary']) {
330
+ // https://datatracker.ietf.org/doc/html/rfc7232#section-4.1 + set-cookie
331
+ for (const key of [
332
+ 'cache-control',
333
+ 'content-location',
334
+ 'date',
335
+ 'expires',
336
+ 'vary',
337
+ 'set-cookie'
338
+ ]) {
332
339
  const value = response.headers.get(key);
333
340
  if (value) headers.set(key, value);
334
341
  }