rimashah25 commented on a change in pull request #5017:
URL: https://github.com/apache/trafficcontrol/pull/5017#discussion_r490408161
##########
File path: traffic_ops/v3-client/deliveryservice_regexes.go
##########
@@ -39,3 +43,23 @@ func (to *Session) GetDeliveryServiceRegexesByDSID(dsID int,
params map[string]s
}
return response.Response, reqInf, nil
}
+
+func (to *Session) PostDeliveryServiceRegexesByDSID(dsID int, regex
tc.DeliveryServiceRegexPost) (tc.Alerts, ReqInf, error) {
+ var alerts tc.Alerts
+ var remoteAddr net.Addr
+ reqInf := ReqInf{CacheHitStatus: CacheHitStatusMiss, RemoteAddr:
remoteAddr}
+ reqBody, err := json.Marshal(regex)
+ if err != nil {
+ return alerts, reqInf, err
+ }
+
+ resp, remoteAddr, err := to.request(http.MethodPost,
fmt.Sprintf(API_DS_POST_REGEXES, dsID), reqBody, nil)
+ reqInf.RemoteAddr = remoteAddr
+ reqInf.StatusCode = resp.StatusCode
Review comment:
I'll check for nil response.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]