Skip to content

Commit

Permalink
bump bun version
Browse files Browse the repository at this point in the history
  • Loading branch information
cdleveille committed May 24, 2024
1 parent 68544bb commit 591812d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
version: 1.1.0
version: 1.1.9

- run: bun i
- run: bun lint
2 changes: 1 addition & 1 deletion .github/workflows/deploy-flyio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
version: 1.1.0
version: 1.1.9

- run: bun i
- run: bun lint
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:1

# Adjust BUN_VERSION as desired
ARG BUN_VERSION=1.1.0
ARG BUN_VERSION=1.1.9
FROM oven/bun:${BUN_VERSION} as base

LABEL fly_launch_runtime="Bun"
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/disc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const initDiscRoutes = (app: Elysia) => {
/* Insert discs (bearer auth secured) */
app.post("/disc", async ({ set, request }) => {
try {
const discs = (await Bun.readableStreamToJSON(request.body)) as IDisc[];
assertIsRequestAuthorized(request);
const discs = (await Bun.readableStreamToJSON(request.body)) as IDisc[];
await Disc.insertMany(discs);
} catch (error) {
return errorResponse(set, error);
Expand All @@ -68,8 +68,8 @@ export const initDiscRoutes = (app: Elysia) => {
/* Delete disc by id (bearer auth secured) */
app.delete("/disc/:id", async ({ set, params, request }) => {
try {
const { id } = params as Record<string, string>;
assertIsRequestAuthorized(request);
const { id } = params as Record<string, string>;
const disc = await Disc.findOne({ id });
if (!disc) throw { code: 404, data: "Disc not found." };
await Disc.deleteOne({ id });
Expand Down
2 changes: 1 addition & 1 deletion src/services/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Config } from "@helpers";

export const getAuthToken = (request: Request) => {
const bearerToken = request.headers.get("Authorization");
return bearerToken?.split("Bearer ")[1];
return bearerToken?.split("Bearer ")?.[1];
};

export const assertIsRequestAuthorized = (request: Request) => {
Expand Down

0 comments on commit 591812d

Please sign in to comment.