Skip to content

Commit fa039bb

Browse files
author
Paxx
committed
fix: improved the RequestRecordingStart internal struct obj. Extracted it to another struct
1 parent 63c4c0f commit fa039bb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ovenmedia/ovenmedia.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ func (o *ovenMedia) IsDebug() bool {
5353
// Resty Methods
5454

5555
func (o *ovenMedia) post(url string, body interface{}) (*resty.Response, error) {
56-
resp, err := o.restClient.R().
57-
SetHeader("Accept", "application/json").
58-
SetBody(body).
59-
Post(url)
56+
r := o.restClient.R().
57+
SetHeader("Accept", "application/json")
58+
59+
if body != nil {
60+
r.SetBody(body)
61+
}
62+
63+
resp, err := r.Post(url)
6064

6165
if err != nil {
6266
return nil, err

ovenmedia/recording.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (o *ovenMedia) StopRecording(vHost string, appName string, body RequestReco
3838

3939
//
4040

41-
func (o *ovenMedia) GetRecordingState(vHost string, appName string, body RequestRecordingStop) (*ResponseRecordingStart, error) {
41+
func (o *ovenMedia) GetRecordingState(vHost string, appName string, body *RequestRecordingStop) (*ResponseRecordingStart, error) {
4242
//
4343
resp, err := o.post(GET_VHOSTS_RECORDS_BY_NAME(vHost, appName), body)
4444
if err != nil {

0 commit comments

Comments
 (0)