You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ro...@apache.org on 2019/01/29 18:38:12 UTC

[trafficcontrol] branch master updated: Return a JSON response with a 200 for successful PUT snapshot

This is an automated email from the ASF dual-hosted git repository.

rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 25d7546  Return a JSON response with a 200 for successful PUT snapshot
25d7546 is described below

commit 25d754656d23ca505fb25c6c39190c3f25de7673
Author: Rawlin Peters <ra...@comcast.com>
AuthorDate: Tue Jan 29 10:40:20 2019 -0700

    Return a JSON response with a 200 for successful PUT snapshot
    
    This fixes the deviation from the Perl implementation which returned a
    JSON response, fixing any clients that are currently broken due to
    expecting a JSON response from this endpoint (e.g. the Python TO
    client).
    
    Fixes #3276.
---
 traffic_ops/traffic_ops_golang/crconfig/handler.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traffic_ops/traffic_ops_golang/crconfig/handler.go b/traffic_ops/traffic_ops_golang/crconfig/handler.go
index 22a05da..99c66b3 100644
--- a/traffic_ops/traffic_ops_golang/crconfig/handler.go
+++ b/traffic_ops/traffic_ops_golang/crconfig/handler.go
@@ -164,7 +164,7 @@ func SnapshotHandler(w http.ResponseWriter, r *http.Request) {
 	}
 
 	api.CreateChangeLogRawTx(api.ApiChange, "Snapshot of CRConfig and Monitor performed for "+cdn, inf.User, inf.Tx.Tx)
-	w.WriteHeader(http.StatusOK) // TODO change to 204 No Content in new version
+	api.WriteResp(w, r, "SUCCESS")
 }
 
 // SnapshotGUIHandler creates the CRConfig JSON and writes it to the snapshot table in the database. The response emulates the old Perl UI function. This should go away when the old Perl UI ceases to exist.