• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

18F / hmacauth / 8
88%

Build:
DEFAULT BRANCH: master
Ran 09 Oct 2015 10:35PM UTC
Jobs 1
Files 1
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
8

Pull #4

travis-ci

mbland
Ensure the request body buffer is not exhausted

Was notified of the issue when @dlapiduz pinged me about POST requests
to https://tock.18f.gov/ resulting in 500s. Digging in the oauth2_proxy logs,
I noticed messages like this appearing before every 500:

```
2015/10/09 16:08:15 reverseproxy.go:184: http: proxy error: http: ContentLength=128 with Body length 0
```

Searching for that error string turned up:

https://stackoverflow.com/questions/23070876/reading-body-of-http-request-without-modifying-request-state

The issue was that reading from `http.Request.Body` to generate the request
signature was exhausting the `io.ReadCloser`. The solution was to read the
entire body into a new buffer, wrap that buffer in an `ioutil.NopCloser` and
assign it back to `http.Request.Body`, and then use that same buffer to
compute the signature.

The new assert statement in `TestRequestSignaturePost` reproduced the original
bug and verified the fix.
Pull Request #4: Ensure the request body buffer is not exhausted

3 of 3 new or added lines in 1 file covered. (100.0%)

99 of 113 relevant lines covered (87.61%)

12.75 hits per line

Jobs
ID Job ID Ran Files Coverage
1 8.1 09 Oct 2015 10:35PM UTC 0
87.61
Travis Job 8.1
Source Files on build 8
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #8
  • Pull Request #4
  • PR Base - master (#7)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc