Skip to content

Handle file upload request - #52

Open
wanlin31 wants to merge 1 commit into
google:mainfrom
wanlin31:files
Open

Handle file upload request#52
wanlin31 wants to merge 1 commit into
google:mainfrom
wanlin31:files

Conversation

@wanlin31

@wanlin31wanlin31 commented Sep 15, 2025

Copy link
Copy Markdown
Collaborator

Allow the byte data fall through to req.body without changing it.

This is needed for file.upload. Added a test to demonstrate.

@wanlin31
wanlin31force-pushed the files branch 2 times, most recently from 682d5ad to cbb76a5CompareSeptember 16, 2025 17:09
@wanlin31wanlin31 changed the title Hnadle file uploadHandle file upload requestSep 16, 2025
@@ -112,8 +112,16 @@ func readBody(req *http.Request) (map[string]any, error) {
}
err = json.Unmarshal(body, &resultMap)
if err != nil {

@wanlin31wanlin31Sep 16, 2025

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

When the data can't be json.unmarshal, they can be the byte data from file upload. We let the byte data fall through to req.body without changing it.

@@ -0,0 +1,56 @@
{

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

This new file is part of the file upload, there was issue inside the genai python file upload, the headers are not passing through, have an internal fix for that.

@wanlin31
wanlin31 marked this pull request as ready for review September 16, 2025 17:50
@wanlin31
wanlin31 requested review from Annhiluc and hkt74 and removed request for Annhiluc and hkt74September 16, 2025 17:50
Sign up for freeto 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

@wanlin31