svelte-adapter-uws 0.4.7 → 0.4.8

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/README.md CHANGED
@@ -630,7 +630,7 @@ The `upgrade` function receives an `UpgradeContext`:
630
630
  {
631
631
  headers: { 'cookie': '...', 'host': 'localhost:3000', ... }, // all lowercase
632
632
  cookies: { session_id: 'abc123', theme: 'dark' }, // parsed from Cookie header
633
- url: '/ws', // request path
633
+ url: '/ws?token=abc', // request path + query string
634
634
  remoteAddress: '127.0.0.1' // client IP
635
635
  }
636
636
  ```
package/files/handler.js CHANGED
@@ -1471,7 +1471,8 @@ if (WS_ENABLED) {
1471
1471
  }
1472
1472
 
1473
1473
  // -- User upgrade handler path (may be async) --
1474
- const url = req.getUrl();
1474
+ const query = req.getQuery();
1475
+ const url = query ? req.getUrl() + '?' + query : req.getUrl();
1475
1476
 
1476
1477
  let aborted = false;
1477
1478
  res.onAborted(() => {
package/index.d.ts CHANGED
@@ -209,7 +209,7 @@ export interface UpgradeContext {
209
209
  headers: Record<string, string>;
210
210
  /** Parsed cookies from the Cookie header. */
211
211
  cookies: Record<string, string>;
212
- /** The request URL path. */
212
+ /** The request URL path, including query string if present (e.g. '/ws?token=abc'). */
213
213
  url: string;
214
214
  /** Remote IP address. */
215
215
  remoteAddress: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-adapter-uws",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "SvelteKit adapter for uWebSockets.js - high-performance C++ HTTP server with built-in WebSocket support",
5
5
  "author": "Kevin Radziszewski",
6
6
  "license": "MIT",
package/vite.js CHANGED
@@ -358,7 +358,7 @@ export default function uws(options = {}) {
358
358
  userHandlers.upgrade({
359
359
  headers,
360
360
  cookies: parseCookies(headers['cookie']),
361
- url: pathname,
361
+ url: req.url || pathname,
362
362
  remoteAddress: req.socket?.remoteAddress || ''
363
363
  })
364
364
  );