Skip to content

Commit bb72c7c

Browse files
committed
fix(supabase): valid Cache-Control directive on upload; clarify functionName description
- storage upload: expand a bare numeric cache-control to `max-age=<n>` (a raw number is not a valid Cache-Control header) - block: functionName input description now covers RPC, vector search, and Edge Function invoke
1 parent e30d513 commit bb72c7c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

apps/sim/app/api/tools/supabase/storage-upload/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
175175
}
176176

177177
if (validatedData.cacheControl) {
178-
headers['cache-control'] = validatedData.cacheControl
178+
const cacheControl = validatedData.cacheControl.trim()
179+
headers['cache-control'] = /^\d+$/.test(cacheControl)
180+
? `max-age=${cacheControl}`
181+
: cacheControl
179182
}
180183

181184
if (validatedData.upsert) {

apps/sim/blocks/blocks/supabase.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,8 @@ Return ONLY the PostgREST filter expression - no explanations, no markdown, no e
12071207
offset: { type: 'number', description: 'Number of rows to skip' },
12081208
functionName: {
12091209
type: 'string',
1210-
description: 'PostgreSQL function name for vector search or RPC',
1210+
description:
1211+
'Function name — PostgreSQL function for RPC or vector search, or Edge Function name to invoke',
12111212
},
12121213
queryEmbedding: { type: 'array', description: 'Query vector/embedding for similarity search' },
12131214
matchThreshold: { type: 'number', description: 'Minimum similarity threshold (0-1)' },

0 commit comments

Comments
 (0)