rawlinp commented on a change in pull request #3171: Add TO api helper safety 
to prevent double writes
URL: https://github.com/apache/trafficcontrol/pull/3171#discussion_r245742555
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/api/api.go
 ##########
 @@ -60,6 +61,12 @@ func WriteResp(w http.ResponseWriter, r *http.Request, v 
interface{}) {
 
 // WriteRespRaw acts like WriteResp, but doesn't wrap the object in a 
`{"response":` object. This should be used to respond with endpoints which 
don't wrap their response in a "response" object.
 func WriteRespRaw(w http.ResponseWriter, r *http.Request, v interface{}) {
+       if getWroteResp(r) {
 
 Review comment:
   My only suggestion would be renaming these `respWritten` and 
`setRespWritten`. Overall I think this PR looks good.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to