Skip to content

Commit

Permalink
bug fix for handling 11.5.1 package uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
ShocOne committed Jun 3, 2024
1 parent d65fe13 commit a9edcd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apiintegrations/jamfpro/jamfpro_api_headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ func (j *JamfAPIHandler) GetContentTypeHeader(endpoint string, log logger.Logger
}
}

// Special case for package upload endpoint
if strings.HasPrefix(endpoint, "/api/v1/packages") && strings.HasSuffix(endpoint, "/upload") {
j.Logger.Debug("Content-Type for package upload endpoint defaulting to multipart/form-data", zap.String("endpoint", endpoint))
return "multipart/form-data"
}

// If no specific configuration is found, then check for standard URL patterns.
if strings.Contains(endpoint, "/JSSResource") {
j.Logger.Debug("Content-Type for endpoint defaulting to XML for Classic API", zap.String("endpoint", endpoint))
Expand Down

0 comments on commit a9edcd6

Please sign in to comment.