You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2016/12/12 20:29:13 UTC

[07/33] incubator-trafficcontrol git commit: update client to always use method passed into it when sending requests to TO

update client to always use method passed into it when sending requests to TO


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/df8378b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/df8378b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/df8378b7

Branch: refs/heads/psql-rebase
Commit: df8378b7e1918b7412d4e9a48fbb60a40283d76e
Parents: 821fe9f
Author: David Neuman <da...@gmail.com>
Authored: Wed Nov 30 11:34:53 2016 -0700
Committer: Dave Neuman <ne...@apache.org>
Committed: Fri Dec 2 15:22:55 2016 -0700

----------------------------------------------------------------------
 traffic_ops/client/traffic_ops.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/df8378b7/traffic_ops/client/traffic_ops.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/traffic_ops.go b/traffic_ops/client/traffic_ops.go
index 9c2273d..fe87b92 100644
--- a/traffic_ops/client/traffic_ops.go
+++ b/traffic_ops/client/traffic_ops.go
@@ -158,14 +158,14 @@ func (to *Session) request(method, path string, body []byte) (*http.Response, er
 	var req *http.Request
 	var err error
 
-	if body != nil && method != "GET" {
+	if body != nil {
 		req, err = http.NewRequest(method, url, bytes.NewBuffer(body))
 		if err != nil {
 			return nil, err
 		}
 		req.Header.Set("Content-Type", "application/json")
 	} else {
-		req, err = http.NewRequest("GET", url, nil)
+		req, err = http.NewRequest(method, url, nil)
 		if err != nil {
 			return nil, err
 		}