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

Web UI: Refactor file upload code to make it safer #1298

Merged
merged 2 commits into from
Nov 4, 2023
Merged

Conversation

rdmark
Copy link
Member

@rdmark rdmark commented Nov 4, 2023

  • Use Path objects to construct file upload paths
  • Utility function for dir path validation (reduce cognitive complexity and code duplication)
  • Construct subdir paths without leading "/" (reducing the risk of uploading to file system root)
  • Break out inline literal list and turn it into tuple constant (for readability)

Copy link

sonarcloud bot commented Nov 4, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@rdmark rdmark merged commit 7deb359 into develop Nov 4, 2023
11 of 12 checks passed
@rdmark rdmark deleted the rdmark-issue-1294 branch November 4, 2023 03:00
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.

2 participants