Skip to content

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

Merged
rdmark merged 2 commits intodevelopfrom
rdmark-issue-1294
Nov 4, 2023
Merged

Web UI: Refactor file upload code to make it safer#1298
rdmark merged 2 commits intodevelopfrom
rdmark-issue-1294

Conversation

@rdmark
Copy link
Copy Markdown
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)

@rdmark rdmark force-pushed the rdmark-issue-1294 branch from 3e1359f to 7edf56b Compare November 4, 2023 00:29
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud 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
@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