Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(upload): bug sur l'ajout de l'extension #1367

Merged
merged 3 commits into from
Apr 24, 2024
Merged

Conversation

maxgfr
Copy link
Member

@maxgfr maxgfr commented Apr 24, 2024

fix #1366

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

const extension = file.originalFilename
?.toLowerCase()
.split(".")
.reverse()[0];
if (!extension) return false;
return ALLOWED_EXTENSIONS.includes(extension);
return ALLOWED_EXTENSIONS.includes("." + extension);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tout ça à cause de ça x)

Comment on lines +35 to +37
return res
.status(400)
.json({ success: false, errorMessage: "Malicious code detected" });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je gère mieux les erreurs comme ça, car ça venait du fait que le fichier était pas considéré comme safe

@maxgfr maxgfr requested review from m-maillot and Viczei April 24, 2024 08:57
@maxgfr maxgfr merged commit 5f94886 into master Apr 24, 2024
19 checks passed
@maxgfr maxgfr deleted the maxgfr/fix-extension branch April 24, 2024 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible d'upload un fichier sur l'admin
4 participants