Skip to content

Add dependency-free file upload validation - #126

Merged
strider2038 merged 1 commit into
mainfrom
feat/file-upload-validation
Oct 2, 2026
Merged

strider2038 merged 1 commit into
mainfrom
feat/file-upload-validation

Conversation

@strider2038

Copy link
Copy Markdown
Contributor

Add independent validation of upload filenames, extensions, declared MIME metadata, and detected content without introducing dependencies.

  • Add it.IsFileName with optional Windows restrictions, it.HasFileExtension with compound suffix support, it.IsMIMEType, and it.HasContentType, plus standalone validate functions.
  • Use http.DetectContentType by default and accept a replacement detector. Document application-side gabriel-vasile/mimetype adapters, bounded multipart reads, and extension/content matching.
  • Include English/Russian messages, configuration-error handling, examples, and changelog documentation. Empty inputs remain optional; content detection does not establish file integrity.

Validation: bash scripts/test-all.sh passed, including lint, unit tests, race tests, module tidy diff, and module verification. New implementation files have 100% statement coverage. go.mod and go.sum are unchanged.

@strider2038
strider2038 merged commit d20002c into main Oct 2, 2026
4 checks passed
@strider2038
strider2038 deleted the feat/file-upload-validation branch October 2, 2026 18:57
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