Skip to content

fix(utils): strip edge whitespace in upload filenames - #688

Open
santhreal wants to merge 6 commits into
HKUDS:devfrom
santhreal:fix/validate-upload-strip-whitespace
Open

fix(utils): strip edge whitespace in upload filenames#688
santhreal wants to merge 6 commits into
HKUDS:devfrom
santhreal:fix/validate-upload-strip-whitespace

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

validate_upload_safety treated a trailing space as part of the extension (e.g. ".pdf "), so otherwise valid uploads were rejected.

Strip leading and trailing whitespace from the filename before checking the extension allowlist.

Trailing spaces left the extension as ``.pdf ``, so a normal PDF upload
failed the allowlist with a misleading unsupported-type error.
…strip-whitespace

# Conflicts:
#	deeptutor/skills/builtin/pdf/SKILL.md
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.

1 participant