Skip to content

Commit

Permalink
Merge pull request #92 from Dray56/if_match_header_add
Browse files Browse the repository at this point in the history
If-Match tag for update users/groups
  • Loading branch information
joefitzgerald authored Jul 27, 2024
2 parents be66c6b + 1e9ac7c commit d675ee3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"

"errors"
Expand All @@ -16,6 +17,9 @@ import (
)

func (a *API) doJSON(method string, url *url.URL, body io.Reader, response interface{}, needsAuthentication bool) error {
if strings.Contains(url.Path, "/Users/") || strings.Contains(url.Path, "/Groups/") && method == "PUT" {
return a.doJSONWithHeaders(method, url, map[string]string{"If-Match": "*"}, body, response, needsAuthentication)
}
return a.doJSONWithHeaders(method, url, nil, body, response, needsAuthentication)
}

Expand Down

0 comments on commit d675ee3

Please sign in to comment.