Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ 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"
"github.com/gleanwork/api-client-go/models/apierrors"
"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 {
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions indexingdocuments.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ 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"
"github.com/gleanwork/api-client-go/models/apierrors"
"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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions people.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ 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"
"github.com/gleanwork/api-client-go/models/apierrors"
"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 {
Expand Down Expand Up @@ -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
Expand Down