ocket8888 commented on a change in pull request #5475:
URL: https://github.com/apache/trafficcontrol/pull/5475#discussion_r569810639
##########
File path: traffic_ops/traffic_ops_golang/crconfig/handler.go
##########
@@ -75,8 +77,17 @@ func SnapshotGetHandler(w http.ResponseWriter, r
*http.Request) {
api.HandleErr(w, r, inf.Tx.Tx, http.StatusNotFound,
errors.New("CDN not found"), nil)
return
}
- w.Header().Set(rfc.ContentType, rfc.ApplicationJSON)
- w.Write([]byte(`{"response":` + snapshot + `}`))
+
+ var decoded tc.CRConfig
+ if err = json.Unmarshal([]byte(snapshot), &decoded); err != nil {
+ api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError,
nil, fmt.Errorf("failed to unmarshal stored snapshot for cdn '%s': %v",
inf.Params["cdn"], err))
+ }
+
+ if inf.Version.Major < 4 {
Review comment:
Yes, I think so. Unless we're removing that in this PR. So I'll wait to
do anything until that's decided.
----------------------------------------------------------------
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]