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 +1 -1
- package/files/handler.js +2 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/vite.js +1 -1
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',
|
|
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
|
|
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
package/vite.js
CHANGED