From 803057b3a5254161ea8a51b4e99842c6bdd4595f Mon Sep 17 00:00:00 2001 From: Rizky Date: Thu, 20 Jun 2024 12:22:44 +0700 Subject: [PATCH] fix proxy --- Dockerfile | 2 +- app/srv/api/api | 9 +++++++++ pkgs/core/api/_proxy.ts | 2 -- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 app/srv/api/api diff --git a/Dockerfile b/Dockerfile index c298f23d..35de613f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM oven/bun:1.1.10 as base +FROM oven/bun:1.1.13 as base WORKDIR /app/prasi/repo RUN apt-get update diff --git a/app/srv/api/api b/app/srv/api/api new file mode 100644 index 00000000..e3e53ec4 --- /dev/null +++ b/app/srv/api/api @@ -0,0 +1,9 @@ +import { apiContext } from "service-srv"; + +export const _ = { + url: "/", + async api() { + const { req, res } = apiContext(this); + return "This is api"; + } +} \ No newline at end of file diff --git a/pkgs/core/api/_proxy.ts b/pkgs/core/api/_proxy.ts index 86b01e43..39276372 100644 --- a/pkgs/core/api/_proxy.ts +++ b/pkgs/core/api/_proxy.ts @@ -38,8 +38,6 @@ export const _ = { res_body = await res.arrayBuffer(); if (res_headers["content-encoding"] === "gzip") { res_body = await gzipAsync(new Uint8Array(res_body)); - } if (res_headers["content-encoding"] === "br") { - res_body = brotli.decompress(new Uint8Array(res_body)); } else { delete res_headers["content-encoding"]; }