Skip to content

Commit

Permalink
1.0.2 - actually rewrite incoming headers correctly, fix release scri…
Browse files Browse the repository at this point in the history
…pt and types
  • Loading branch information
IncognitoTGT committed Jul 15, 2024
1 parent 9d8c4e6 commit df421f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meteorproxy",
"version": "1.0.1",
"version": "1.0.2",
"description": "The modern interception proxy you've been waiting for",
"type": "module",
"main": "./lib/index.cjs",
Expand All @@ -13,7 +13,7 @@
"build": "tsx build.ts",
"demo": "tsx server.ts",
"demo:lite": "tsx server.ts --no-build",
"release": "tsc && biome check . --write npm run build && npm publish --access public",
"release": "tsc && biome check . --write && npm run build && npm publish --access public",
"check": "biome check . --write",
"typecheck": "tsc"
},
Expand Down
2 changes: 1 addition & 1 deletion src/meteor.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('./types').Config} */
/** @type {import('meteorproxy').Config} */
const config = {
prefix: '/route/',
codec: self.__meteor$codecs.xor,
Expand Down
6 changes: 5 additions & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ class MeteorServiceWorker {

return new Response(response.body)
}
const fetchHead = new Headers(request.headers)
fetchHead.set('cookie', (await getCookies(url.host)).join('; '))
fetchHead.set('host', url.host)
fetchHead.set('origin', url.origin)
let response: BareResponseFetch = await this.client.fetch(url, {
method: request.method,
body: request.body,
headers: request.headers,
headers: fetchHead,
credentials: 'omit',
mode: request.mode === 'cors' ? request.mode : 'same-origin',
cache: request.cache,
Expand Down

0 comments on commit df421f1

Please sign in to comment.