Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #42 from northwesternmutual/writeheader-fix
Browse files Browse the repository at this point in the history
writeheader bug fix
  • Loading branch information
Frank B Greco Jr authored Aug 16, 2017
2 parents 5f3fcd1 + 864886f commit d81c39a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.1.2] - 2017-08-16
### Changed
- If InfluxDB database doesn't exist when writing, it will be created.
- Fixed bug causing `http: multiple response.WriteHeader calls` error if `io.Copy` failed when writing the response.

## [1.1.1] - 2017-08-15
### Changed
Expand Down
20 changes: 20 additions & 0 deletions monitor/influxdb_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// Copyright (c) 2017 Northwestern Mutual.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package monitor

import (
Expand Down
3 changes: 1 addition & 2 deletions steps/writeresponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ func (step WriteResponseStep) Do(ctx context.Context, m *metrics.Metrics, c *con
w.WriteHeader(resp.StatusCode)

if _, err := io.Copy(w, closer); err != nil {
return err
return nil
}

return nil

}

0 comments on commit d81c39a

Please sign in to comment.