Skip to content

Commit fbadb4e

Browse files
fix(client): correctly specify Accept header with */* instead of empty
1 parent 5b89d3b commit fbadb4e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (r *ContainerService) ListAutoPaging(ctx context.Context, query ContainerLi
8686
// Delete Container
8787
func (r *ContainerService) Delete(ctx context.Context, containerID string, opts ...option.RequestOption) (err error) {
8888
opts = slices.Concat(r.Options, opts)
89-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
89+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
9090
if containerID == "" {
9191
err = errors.New("missing required container_id parameter")
9292
return

containerfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (r *ContainerFileService) ListAutoPaging(ctx context.Context, containerID s
106106
// Delete Container File
107107
func (r *ContainerFileService) Delete(ctx context.Context, containerID string, fileID string, opts ...option.RequestOption) (err error) {
108108
opts = slices.Concat(r.Options, opts)
109-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
109+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
110110
if containerID == "" {
111111
err = errors.New("missing required container_id parameter")
112112
return

realtime/call.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func NewCallService(opts ...option.RequestOption) (r CallService) {
4040
// it.
4141
func (r *CallService) Accept(ctx context.Context, callID string, body CallAcceptParams, opts ...option.RequestOption) (err error) {
4242
opts = slices.Concat(r.Options, opts)
43-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
43+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
4444
if callID == "" {
4545
err = errors.New("missing required call_id parameter")
4646
return
@@ -53,7 +53,7 @@ func (r *CallService) Accept(ctx context.Context, callID string, body CallAccept
5353
// End an active Realtime API call, whether it was initiated over SIP or WebRTC.
5454
func (r *CallService) Hangup(ctx context.Context, callID string, opts ...option.RequestOption) (err error) {
5555
opts = slices.Concat(r.Options, opts)
56-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
56+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
5757
if callID == "" {
5858
err = errors.New("missing required call_id parameter")
5959
return
@@ -66,7 +66,7 @@ func (r *CallService) Hangup(ctx context.Context, callID string, opts ...option.
6666
// Transfer an active SIP call to a new destination using the SIP REFER verb.
6767
func (r *CallService) Refer(ctx context.Context, callID string, body CallReferParams, opts ...option.RequestOption) (err error) {
6868
opts = slices.Concat(r.Options, opts)
69-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
69+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
7070
if callID == "" {
7171
err = errors.New("missing required call_id parameter")
7272
return
@@ -79,7 +79,7 @@ func (r *CallService) Refer(ctx context.Context, callID string, body CallReferPa
7979
// Decline an incoming SIP call by returning a SIP status code to the caller.
8080
func (r *CallService) Reject(ctx context.Context, callID string, body CallRejectParams, opts ...option.RequestOption) (err error) {
8181
opts = slices.Concat(r.Options, opts)
82-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
82+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
8383
if callID == "" {
8484
err = errors.New("missing required call_id parameter")
8585
return

responses/response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (r *ResponseService) GetStreaming(ctx context.Context, responseID string, q
120120
// Deletes a model response with the given ID.
121121
func (r *ResponseService) Delete(ctx context.Context, responseID string, opts ...option.RequestOption) (err error) {
122122
opts = slices.Concat(r.Options, opts)
123-
opts = append([]option.RequestOption{option.WithHeader("Accept", "")}, opts...)
123+
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
124124
if responseID == "" {
125125
err = errors.New("missing required response_id parameter")
126126
return

0 commit comments

Comments
 (0)