Skip to content

Commit 1548d1c

Browse files
committed
patch: fix UV to work with updated stuff
1 parent 0c30494 commit 1548d1c

8 files changed

Lines changed: 245 additions & 130 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ debug.log
99
views/dist/*
1010
src/.shutdown
1111
views/archive/gfiles/rarch/roms
12-
.idea
12+
.idea
13+
lib/ultraviolet/

lib/setup-ultraviolet.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
uv="$dir/ultraviolet"
6+
patch="$dir/ultraviolet.patch"
7+
repo="https://github.com/titaniumnetwork-dev/Ultraviolet.git"
8+
9+
if [ ! -d "$uv/.git" ]; then
10+
git clone --quiet "$repo" "$uv"
11+
fi
12+
13+
cd "$uv"
14+
git fetch --quiet origin
15+
git clean -fdx -e node_modules >/dev/null
16+
git apply --whitespace=nowarn "$patch"
17+
pnpm install --ignore-scripts --ignore-workspace --silent
18+
pnpm build

lib/ultraviolet.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/src/uv.sw.js b/src/uv.sw.js
2+
index e3dbf40..4057bd2 100644
3+
--- a/src/uv.sw.js
4+
+++ b/src/uv.sw.js
5+
@@ -122,7 +122,7 @@ class UVServiceWorker extends Ultraviolet.EventEmitter {
6+
? "blob:" + location.origin + requestCtx.url.pathname
7+
: requestCtx.url;
8+
9+
const response = await this.bareClient.fetch(fetchedURL, {
10+
- headers: requestCtx.headers,
11+
+ headers: Object.entries(requestCtx.headers),
12+
method: requestCtx.method,
13+
body: requestCtx.body,
14+
credentials: requestCtx.credentials,

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"proxy-validator": "node proxyServiceValidator.js",
2121
"workflow-test": "node run-command.mjs workflow",
2222
"deployment": "pnpm install && pnpm run build && node backend.js",
23-
"postinstall": "playwright install chromium"
23+
"prepare:uv": "bash lib/setup-ultraviolet.sh",
24+
"postinstall": "pnpm run prepare:uv && playwright install chromium"
2425
},
2526
"keywords": [
2627
"proxy",
@@ -37,8 +38,8 @@
3738
"@mercuryworkshop/libcurl-transport": "^2.0.5",
3839
"@mercuryworkshop/scramjet": "2.0.67-alpha.1",
3940
"@mercuryworkshop/scramjet-controller": "0.0.13",
40-
"@titaniumnetwork-dev/ultraviolet": "^3.2.10",
41-
"axios": "^1.16.1",
41+
"@titaniumnetwork-dev/ultraviolet": "file:./lib/ultraviolet",
42+
"axios": "^1.17.0",
4243
"chii": "^1.15.5",
4344
"fastify": "^5.8.5",
4445
"mrrowisp": "^3.1.6",

pnpm-lock.yaml

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)