fix conflict

This commit is contained in:
Todd Gruben 2020-04-05 18:10:10 -05:00
parent 0e2bb550db
commit 5470753cb5
2 changed files with 3 additions and 1 deletions

View file

@ -1115,6 +1115,7 @@ func (c *InternalClient) SendMessage(ctx context.Context, uri *pilosa.URI, msg [
req.Header.Set("Content-Type", "application/x-protobuf")
req.Header.Set("User-Agent", "pilosa/"+pilosa.Version)
req.Header.Set("Accept", "application/json")
req.Header.Set("Connection", "keep-alive")
// Execute request.
resp, err := c.executeRequest(req.WithContext(ctx))
@ -1232,6 +1233,7 @@ func (c *InternalClient) TranslateIDsNode(ctx context.Context, uri *pilosa.URI,
// is closed.
func (c *InternalClient) executeRequest(req *http.Request) (*http.Response, error) {
tracing.GlobalTracer.InjectHTTPHeaders(req)
req.Close = false
resp, err := c.httpClient.Do(req)
if err != nil {
if resp != nil {

View file

@ -1590,7 +1590,7 @@ func (h *Handler) handlePostClusterMessage(w http.ResponseWriter, r *http.Reques
http.Error(w, "Unsupported media type", http.StatusUnsupportedMediaType)
return
}
defer r.Body.Close()
err := h.api.ClusterMessage(r.Context(), r.Body)
if err != nil {
// TODO this was the previous behavior, but perhaps not everything is a bad request