Skip to content

Commit

Permalink
Test init log (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong authored Mar 22, 2023
1 parent 7022cf5 commit 02e712f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion route/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func InitV1Router() *gin.Engine {

// File uploads need to be handled separately, and will not be modified here
//v1FileGroup.POST("/upload", v1.PostFileUpload)
v1FileGroup.POST("/upload", v1.PostFileOctet)
v1FileGroup.POST("/upload", v1.PostFileUpload)
v1FileGroup.GET("/upload", v1.GetFileUpload)
// v1FileGroup.GET("/download", v1.UserFileDownloadCommonService)
v1FileGroup.GET("/ws", v1.ConnectWebSocket)
Expand Down
3 changes: 1 addition & 2 deletions route/v1/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,13 @@ func PostFileOctet(c *gin.Context) {
content_type := content_type_[0]
const BOUNDARY string = "; boundary="
loc := strings.Index(content_type, BOUNDARY)
if -1 == loc {
if loc == -1 {
log.Printf("Content-Type error, no boundary\n")
c.JSON(http.StatusBadRequest, model.Result{Success: common_err.CLIENT_ERROR, Message: common_err.GetMsg(common_err.CLIENT_ERROR), Data: "Content-Type error, no boundary"})
return
}
boundary := []byte(content_type[(loc + len(BOUNDARY)):])
log.Printf("[%s]\n\n", boundary)
//
read_data := make([]byte, 1024*24)
var read_total int = 0
for {
Expand Down

0 comments on commit 02e712f

Please sign in to comment.