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

Add file check middleware #269

Merged
merged 5 commits into from
Dec 18, 2024
Merged

Conversation

AmirAgassi
Copy link
Member

Checklist

Before opening this PR, make sure the PR:

  • Has an assignee or group of assignees.
  • Is labelled properly.
  • Has the SPUR project assigned to it.
  • Has an assigned milestone.

Additionally, make sure that:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Description

Adds middleware to validate file upload sizes with configurable min/max limits.

Linked Issues

Type of Change

  • New feature (non-breaking change which adds functionality).

Testing

  • backend/internal/middleware/upload_test.go

@AmirAgassi AmirAgassi added enhancement New feature or request backend Related to the backend of the project labels Dec 18, 2024
@AmirAgassi AmirAgassi added this to the Complete the project MVP milestone Dec 18, 2024
@AmirAgassi AmirAgassi self-assigned this Dec 18, 2024
@AmirAgassi AmirAgassi linked an issue Dec 18, 2024 that may be closed by this pull request
4 tasks
@AmirAgassi AmirAgassi added the middleware Related to any backend middleware label Dec 18, 2024
@AmirAgassi AmirAgassi changed the title Add file check middleware [BE Feat] Add file check middleware Dec 18, 2024
@AmirAgassi AmirAgassi changed the title [BE Feat] Add file check middleware Add file check middleware Dec 18, 2024
Copy link
Contributor

@juancwu juancwu left a comment

Choose a reason for hiding this comment

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

I would change the file name to file_size_check instead of upload, but anything else is lgtm

@AmirAgassi AmirAgassi requested a review from juancwu December 18, 2024 21:15
Copy link
Member

@aidantrabs aidantrabs left a comment

Choose a reason for hiding this comment

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

lgtm

@AmirAgassi AmirAgassi merged commit 1ef1cbe into main Dec 18, 2024
4 checks passed
@AmirAgassi AmirAgassi deleted the feat/211/file-size-check-middleware branch December 18, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the backend of the project enhancement New feature or request middleware Related to any backend middleware
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BE Feat] Create file size check middleware
3 participants