diff --git a/datasource.go b/datasource.go index d65759a7..90506dc1 100644 --- a/datasource.go +++ b/datasource.go @@ -6,6 +6,8 @@ import ( "bytes" "context" "fmt" + "net/http" + "github.com/gleanwork/api-client-go/internal/config" "github.com/gleanwork/api-client-go/internal/hooks" "github.com/gleanwork/api-client-go/internal/utils" @@ -13,7 +15,6 @@ import ( "github.com/gleanwork/api-client-go/models/components" "github.com/gleanwork/api-client-go/models/operations" "github.com/gleanwork/api-client-go/retry" - "net/http" ) type Datasource struct { @@ -200,7 +201,7 @@ func (s *Datasource) Status(ctx context.Context, datasource string, opts ...oper switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json; charset=UTF-8`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { return nil, err diff --git a/indexingdocuments.go b/indexingdocuments.go index a3325636..1899bcf5 100644 --- a/indexingdocuments.go +++ b/indexingdocuments.go @@ -6,6 +6,9 @@ import ( "bytes" "context" "fmt" + "net/http" + "net/url" + "github.com/gleanwork/api-client-go/internal/config" "github.com/gleanwork/api-client-go/internal/hooks" "github.com/gleanwork/api-client-go/internal/utils" @@ -13,8 +16,6 @@ import ( "github.com/gleanwork/api-client-go/models/components" "github.com/gleanwork/api-client-go/models/operations" "github.com/gleanwork/api-client-go/retry" - "net/http" - "net/url" ) type IndexingDocuments struct { @@ -1223,7 +1224,7 @@ func (s *IndexingDocuments) Debug(ctx context.Context, datasource string, debugD switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json; charset=UTF-8`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { return nil, err @@ -1448,7 +1449,7 @@ func (s *IndexingDocuments) DebugMany(ctx context.Context, datasource string, de switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json; charset=UTF-8`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { return nil, err diff --git a/people.go b/people.go index 979803b0..44d3baed 100644 --- a/people.go +++ b/people.go @@ -6,6 +6,9 @@ import ( "bytes" "context" "fmt" + "net/http" + "net/url" + "github.com/gleanwork/api-client-go/internal/config" "github.com/gleanwork/api-client-go/internal/hooks" "github.com/gleanwork/api-client-go/internal/utils" @@ -13,8 +16,6 @@ import ( "github.com/gleanwork/api-client-go/models/components" "github.com/gleanwork/api-client-go/models/operations" "github.com/gleanwork/api-client-go/retry" - "net/http" - "net/url" ) type People struct { @@ -209,7 +210,7 @@ func (s *People) Debug(ctx context.Context, datasource string, debugUserRequest switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json; charset=UTF-8`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { return nil, err