Skip to content

Commit

Permalink
Looks like we don't need to decode the ID manually
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Jan 29, 2025
1 parent 1fe6af9 commit b929f44
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions server/service/scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -766,16 +766,6 @@ func (updateScriptRequest) DecodeRequest(ctx context.Context, r *http.Request) (
}
}

val := r.MultipartForm.Value["id"]
if len(val) < 1 {
return nil, &fleet.BadRequestError{Message: "no script id"}
}
scriptID, err := strconv.ParseUint(val[0], 10, 0)
if err != nil {
return nil, &fleet.BadRequestError{Message: fmt.Sprintf("failed to decode id in multipart form: %s", err.Error())}
}
decoded.ScriptID = uint(scriptID)

fhs, ok := r.MultipartForm.File["script"]
if !ok || len(fhs) < 1 {
return nil, &fleet.BadRequestError{Message: "no file headers for script"}
Expand Down

0 comments on commit b929f44

Please sign in to comment.