Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(self-hosted): do not ignore additional config in create storage bucket request (#20213)

Gulfaraz Rahman7f1c6a04c272
diff --git a/apps/studio/pages/api/storage/[ref]/buckets/index.ts b/apps/studio/pages/api/storage/[ref]/buckets/index.ts
index e426db1810c..60a36762737 100644
--- a/apps/studio/pages/api/storage/[ref]/buckets/index.ts
+++ b/apps/studio/pages/api/storage/[ref]/buckets/index.ts
@@ -31,9 +31,18 @@ const handleGet = async (req: NextApiRequest, res: NextApiResponse) => {
}
const handlePost = async (req: NextApiRequest, res: NextApiResponse) => {
- const { id, public: isPublicBucket } = req.body
-
- const { data, error } = await supabase.storage.createBucket(id, { public: isPublicBucket })
+ const {
+ id,
+ public: isPublicBucket,
+ allowed_mime_types: allowedMimeTypes,
+ file_size_limit: fileSizeLimit,
+ } = req.body
+
+ const { data, error } = await supabase.storage.createBucket(id, {
+ public: isPublicBucket,
+ allowedMimeTypes,
+ fileSizeLimit,
+ })
if (error) {
return res.status(400).json({ error: { message: error.message } })
}