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

Allow user specify file in mg_http_upload #2599

Merged
merged 1 commit into from
Feb 4, 2024
Merged

Allow user specify file in mg_http_upload #2599

merged 1 commit into from
Feb 4, 2024

Conversation

cpq
Copy link
Member

@cpq cpq commented Feb 4, 2024

This PR also fixes a bug in mg_path_is_sane(), and adds unit tests for it

@cpq cpq requested a review from scaprile February 4, 2024 08:53
@cpq cpq merged commit 93b5063 into master Feb 4, 2024
60 of 63 checks passed
@cpq cpq deleted the upload branch February 4, 2024 09:07
Comment on lines +194 to 195
if (s[0] == '/' || s[0] == '\\') { // Subdir?
if (s[1] == '.' && s[2] == '.') return false; // Starts with ..
Copy link
Collaborator

Choose a reason for hiding this comment

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

if (s[0] == MG_DIRSEP && s[1] == '.' && s[2] == '.') return false;  // Subdir with ..

? Bonus: the other slash is allowed

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