@noverax/courier-sveltekit 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/lib/index.js +2 -2
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as svelteKitRequestContext, r as svelteKitClientAddress, t as svelteKitIncomingRequest } from "./request-context-UtZzeQWD.js";
2
2
  import { createHandler, handleWhileConnected } from "@noverax/courier";
3
3
  import { announceWhenRegistered } from "@noverax/courier/announce";
4
- import { rememberPeerAddress } from "@noverax/courier/internal";
4
+ import { rememberPeerAddress, serverOriginOf } from "@noverax/courier/internal";
5
5
  //#region src/index.ts
6
6
  /**
7
7
  * Create a SvelteKit request handler for the courier proxy.
@@ -41,8 +41,8 @@ function courierHandler(config) {
41
41
  framework: "sveltekit"
42
42
  });
43
43
  return (event) => {
44
- announce(new URL(event.request.url).origin);
45
44
  rememberPeerAddress(event.request, svelteKitClientAddress(event));
45
+ announce(serverOriginOf(event.platform?.req?.socket));
46
46
  return handleWhileConnected(handle, event.request, event.platform?.req?.socket);
47
47
  };
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noverax/courier-sveltekit",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "SvelteKit adapter for Courier: an endpoint that proxies typed calls to any backend, with the user's session in load functions and form actions",
5
5
  "keywords": [
6
6
  "courier",
@@ -72,7 +72,7 @@
72
72
  "access": "public"
73
73
  },
74
74
  "peerDependencies": {
75
- "@noverax/courier": "^0.3.0"
75
+ "@noverax/courier": "^0.3.1"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@noverax/courier": "*"