Skip to content

Commit dd17259

Browse files
committed
Set Content-Type header for PATCH requests on software title configurations
1 parent 18140d3 commit dd17259

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jamf/jamfprointegration/headers.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ const (
3535
func (j *Integration) getContentTypeHeader(endpoint string) string {
3636
j.Sugar.Debug("Determining Content-Type for endpoint", zap.String("endpoint", endpoint))
3737

38+
// Set this header for PATCH requests on patch software title configurations
39+
if strings.Contains(endpoint, "/api/v2/patch-software-title-configurations/") {
40+
j.Sugar.Debugw("Content-Type for PATCH endpoint set to application/merge-patch+json", "endpoint", endpoint)
41+
return "application/merge-patch+json"
42+
}
43+
3844
// TODO change this contains to regex. We want to rule out malformed endpoints with multiple occurances.
3945
if strings.Contains(endpoint, "/api/v1/packages/") && strings.Contains(endpoint, "/upload") {
4046
j.Sugar.Debugw("Content-Type for packages upload endpoint set to application/octet-stream", "endpoint", endpoint)
@@ -47,7 +53,6 @@ func (j *Integration) getContentTypeHeader(endpoint string) string {
4753

4854
if strings.Contains(endpoint, "/JSSResource") {
4955
j.Sugar.Debugw("Content-Type for endpoint defaulting to XML for Classic API", "endpoint", endpoint)
50-
// TODO should this be application/xml or text/xml?
5156
return "application/xml"
5257
}
5358

0 commit comments

Comments
 (0)