Skip to content

Conversation

@Deekshit014
Copy link

Proposed changes

Please include a summary of the changes here and why we need those changes. And also let us know which issue is fixed.

This Pull Request resolves Issue #220.

The issue was that when a developer attempted to upload data to the /data endpoint using the multipart/form-data content type but omitted the required filename, the API returned a generic or confusing validation error.

The change introduces an explicit check at the start of the form upload handler to ensure the file part and filename are present, returning a clear, user-friendly error message (MsgFilenameRequired) instead of letting the request fail later with a misleading error.

Fixes #220


Types of changes

  • Bug fix
  • New feature added
  • Documentation Update

Please make sure to follow these points

  • I have read the contributing guidelines.
  • I have performed a self-review of my own code or work.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generates no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • My changes have sufficient code coverage (unit, integration, e2e tests).

Screenshots (If Applicable)


Other Information

The fix was applied in internal/apiserver/route_post_data.go within the CoreFormUploadHandler. I inserted the check for r.Part == nil || r.Part.FileName == "" at the start of the handler to ensure the error is returned at the point of validation, leading to better developer experience.

@Deekshit014 Deekshit014 requested a review from a team as a code owner October 10, 2025 05:16
@Deekshit014 Deekshit014 force-pushed the fix/misleading-error-220 branch from 6cd4c37 to 4cc3525 Compare October 10, 2025 05:18
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.

Get a misleading error message when uploading file to data endpoint without setting a file name

1 participant