downgrade tus server
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 41s
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 41s
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
"@redwoodjs/api-server": "8.4.0",
|
||||
"@redwoodjs/auth-dbauth-api": "8.4.0",
|
||||
"@redwoodjs/graphql-server": "8.4.0",
|
||||
"@tus/file-store": "^2.0.0",
|
||||
"@tus/server": "^2.0.0",
|
||||
"@tus/file-store": "1.4.0",
|
||||
"@tus/server": "1.7.0",
|
||||
"countries-list": "^3.1.1",
|
||||
"graphql-scalars": "^1.23.0",
|
||||
"nodemailer": "^6.9.14"
|
||||
|
||||
@@ -25,10 +25,11 @@ export const handleTusUpload = (
|
||||
tusHandler: Server,
|
||||
isPublicEndpoint: boolean
|
||||
) => {
|
||||
res.hijack()
|
||||
if (isProduction) {
|
||||
if (req.method === 'OPTIONS') handleOptionsRequest(res)
|
||||
else if (isPublicEndpoint && req.method === 'GET')
|
||||
tusHandler.handle(req.raw, res.raw)
|
||||
void tusHandler.handle(req.raw, res.raw)
|
||||
else if (['GET', 'POST', 'HEAD', 'PATCH'].includes(req.method)) {
|
||||
if (req.headers.cookie) handleAuthenticatedRequest(req, res, tusHandler)
|
||||
else {
|
||||
@@ -41,7 +42,7 @@ export const handleTusUpload = (
|
||||
}
|
||||
} else {
|
||||
setCorsHeaders(res)
|
||||
tusHandler.handle(req.raw, res.raw)
|
||||
void tusHandler.handle(req.raw, res.raw)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import Cors from '@fastify/cors'
|
||||
import RateLimit from '@fastify/rate-limit'
|
||||
import { FileStore } from '@tus/file-store'
|
||||
import { Server } from '@tus/server'
|
||||
|
||||
import { isProduction } from '@redwoodjs/api/logger'
|
||||
import { createServer } from '@redwoodjs/api-server'
|
||||
@@ -15,8 +17,6 @@ enum Theme {
|
||||
|
||||
;(async () => {
|
||||
const { countries } = await import('countries-list')
|
||||
const { FileStore } = await import('@tus/file-store')
|
||||
const { Server } = await import('@tus/server')
|
||||
|
||||
if (!Object.keys(countries).includes(process.env.COUNTRY))
|
||||
throw new Error(
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"target": "ES2023",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "Node16",
|
||||
"moduleResolution": "node16",
|
||||
"skipLibCheck": false,
|
||||
"rootDirs": [
|
||||
"./src",
|
||||
|
||||
Reference in New Issue
Block a user