some styling cleanup

This commit is contained in:
Nystik
2026-03-17 12:38:30 +01:00
parent c70b9e9d0f
commit 0738c47ac5
27 changed files with 479 additions and 105 deletions

View File

@@ -2,10 +2,11 @@ const express = require("express");
const router = express.Router();
// POST /api/proxy - forward a request to an external URL (bypasses browser CORS)
// Used by the requestUrl shim for plugin installation, update checks, etc.
// POST /api/proxy - forward a request to an external URL to bypass CORS
// Used by the requestUrl shim for plugin installation, etc.
router.post("/", async (req, res) => {
const { url, method, headers, body, binary } = req.body;
if (!url) {
return res.status(400).json({ error: "Missing url" });
}
@@ -15,6 +16,7 @@ router.post("/", async (req, res) => {
method: method || "GET",
headers: headers || {},
};
if (body && method !== "GET" && method !== "HEAD") {
if (binary && typeof body === "string") {
fetchOpts.body = Buffer.from(body, "base64");