Fix: CORS and API base URL for music create in staging
- Update CORS config to allow all origins (wildcard first) for better staging support - Change API fetch base URL from absolute to relative (/) to prevent mixed content blocking - Add detailed logging in music create page for better debugging - Update .env.example with better NEXT_PUBLIC_BASE_URL documentation - Add MUSIK_CREATE_ANALYSIS.md with comprehensive error analysis Fixes ERR_BLOCKED_BY_CLIENT error when creating music in staging environment Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -47,15 +47,15 @@ fs.mkdir(UPLOAD_DIR_IMAGE, {
|
||||
|
||||
const corsConfig = {
|
||||
origin: [
|
||||
"*", // Allow all origins - must be first when using credentials: true
|
||||
"http://localhost:3000",
|
||||
"http://localhost:3001",
|
||||
"https://cld-dkr-desa-darmasaba-stg.wibudev.com",
|
||||
"https://cld-dkr-staging-desa-darmasaba.wibudev.com",
|
||||
"*", // Allow all origins in development
|
||||
],
|
||||
methods: ["GET", "POST", "PATCH", "DELETE", "PUT", "OPTIONS"] as HTTPMethod[],
|
||||
allowedHeaders: ["Content-Type", "Authorization", "*"],
|
||||
exposedHeaders: "*",
|
||||
allowedHeaders: ["Content-Type", "Authorization", "Accept", "*"],
|
||||
exposedHeaders: ["Content-Range", "X-Content-Range", "*"],
|
||||
maxAge: 86400, // 24 hours
|
||||
credentials: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user