-
-
Notifications
You must be signed in to change notification settings - Fork 55
Fix file upload bug on server #124
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
Conversation
This reverts commit 37a5bed.
This reverts commit a4a5ef6.
This reverts commit 239443a.
fix t.Files() upload from server side #124
|
Caution Review failedThe pull request is closed. WalkthroughServer-side multipart FormData construction now detects array field values and appends each element individually instead of appending the array as a single value. This affects handling of values like File[] during request body assembly in src/treaty2/index.ts. No exported/public signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant T as treaty2 (server)
participant FB as FormData Builder
participant FD as FormData
participant HTTP as HTTP Client
C->>T: invoke request with body (may include arrays e.g., File[])
T->>FB: build multipart body
FB->>FD: create FormData
alt value is array
loop for each element in array
FB->>FD: append(key, element)
end
else value is single
FB->>FD: append(key, value)
end
FB-->>T: FormData instance
T->>HTTP: send request with FormData body
HTTP-->>C: response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #123
Summary by CodeRabbit