-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Swift Package Manager Publishing using commandline throws error (#33990) #34068
base: main
Are you sure you want to change the base?
Swift Package Manager Publishing using commandline throws error (#33990) #34068
Conversation
Alternative fix with minimal changes: @@ -304,10 +304,18 @@ func UploadPackageFile(ctx *context.Context) {
packageVersion := v.Core().String()
- file, _, err := ctx.Req.FormFile("source-archive")
+ var file io.ReadCloser
+ multipartFile, _, err := ctx.Req.FormFile("source-archive")
if err != nil {
- apiError(ctx, http.StatusBadRequest, err)
- return
+ content := ctx.Req.FormValue("source-archive")
+ if content != "" {
+ file = io.NopCloser(strings.NewReader(content))
+ } else {
+ apiError(ctx, http.StatusBadRequest, err)
+ return
+ }
+ } else {
+ file = multipartFile
}
defer file.Close() + tests |
hi @wgr1984, would you be interested in continuing to complete the pr? |
sure, will finish it once i find a minute to get local build running, in
order to confirm impl. and update test (in case needed)
Am Do., 3. Apr. 2025 um 12:04 Uhr schrieb hiifong ***@***.***
…:
hi @wgr1984 <https://github.com/wgr1984>, would you be interested in
continuing to complete the pr?
—
Reply to this email directly, view it on GitHub
<#34068 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADEBZPEB6PIYRVWM734MXD2XUBRZAVCNFSM6AAAAAB2B5CUJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZVGE3DQNZYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: hiifong]*hiifong* left a comment (go-gitea/gitea#34068)
<#34068 (comment)>
hi @wgr1984 <https://github.com/wgr1984>, would you be interested in
continuing to complete the pr?
—
Reply to this email directly, view it on GitHub
<#34068 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADEBZPEB6PIYRVWM734MXD2XUBRZAVCNFSM6AAAAAB2B5CUJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONZVGE3DQNZYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
a2a92fb
to
6ded601
Compare
…ndline-throws-error
@@ -304,10 +304,18 @@ func UploadPackageFile(ctx *context.Context) { | |||
|
|||
packageVersion := v.Core().String() | |||
|
|||
file, _, err := ctx.Req.FormFile("source-archive") | |||
var file io.ReadCloser | |||
multipartFile, _, err := ctx.Req.FormFile("source-archive") | |||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error here I think may need to be handled separately, if it's a http.ErrMissingFile error then we need to get the file content from FromValue, otherwise it just returns an error.
Fix #33990