Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 404d529

Browse files
committedJan 29, 2025·
Remove .enc check
1 parent 6049738 commit 404d529

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed
 

‎routes/[filename].tsx

-17
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ export const handler: Handlers = {
3333
async PUT(req, ctx) {
3434
try {
3535
const filename = ctx.params.filename
36-
37-
if (!filename.endsWith('.enc')) {
38-
return new Response('Only encrypted files (.enc) are accepted', {
39-
status: 400,
40-
})
41-
}
42-
4336
const size = req.headers.get('content-length')
4437
if (!size || parseInt(size) > MAX_FILE_SIZE) {
4538
return new Response(
@@ -109,12 +102,6 @@ export const handler: Handlers = {
109102
try {
110103
const filename = ctx.params.filename
111104

112-
if (!filename.endsWith('.enc')) {
113-
return new Response('Only encrypted files (.enc) are allowed', {
114-
status: 400,
115-
})
116-
}
117-
118105
// Get file hash from the start of the filename
119106
const fileHash = filename.slice(0, 64) // SHA-256 hash is 64 hex chars
120107

@@ -150,10 +137,6 @@ export const handler: Handlers = {
150137
async DELETE(req, ctx) {
151138
try {
152139
const filename = ctx.params.filename
153-
if (!filename.endsWith('.enc')) {
154-
return new Response('Invalid file type', { status: 400 })
155-
}
156-
157140
const fileHash = filename.slice(0, 64)
158141

159142
const authHeader = req.headers.get('Authorization')

0 commit comments

Comments
 (0)
Please sign in to comment.