File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,17 @@ func uploadHandler(c *gin.Context) {
74
74
return
75
75
}
76
76
77
- if data .Signature == "" {
78
- c .String (http .StatusBadRequest , "signature is required" )
79
- return
80
- }
77
+ if data .Extra .Network == false {
78
+ if data .Signature == "" {
79
+ c .String (http .StatusBadRequest , "signature is required" )
80
+ return
81
+ }
82
+
83
+ if data .Commandline == "" {
84
+ c .String (http .StatusBadRequest , "commandline is required for local board" )
85
+ return
86
+ }
81
87
82
- if data .Extra .Network {
83
88
err := verifyCommandLine (data .Commandline , data .Signature )
84
89
85
90
if err != nil {
@@ -88,16 +93,12 @@ func uploadHandler(c *gin.Context) {
88
93
}
89
94
}
90
95
91
- if data .Extra .Network == false && data .Commandline == "" {
92
- c .String (http .StatusBadRequest , "commandline is required for local board" )
93
- return
94
- }
95
-
96
96
buffer := bytes .NewBuffer (data .Hex )
97
97
98
98
path , err := saveFileonTempDir (data .Filename , buffer )
99
99
if err != nil {
100
100
c .String (http .StatusBadRequest , err .Error ())
101
+ return
101
102
}
102
103
103
104
if data .Rewrite != "" {
You can’t perform that action at this time.
0 commit comments