fix for bad header value

Go tool brought in changes that properly implement:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

merged in here:
https://go-review.googlesource.com/#/c/23229/

This surfaced a bad http header value in our tests.

Change-Id: I2c507bb4c92b060c78a7909600649dae2d22515d
This commit is contained in:
Stephen McQuay 2016-06-17 09:15:09 -07:00
parent 1bceefffb0
commit b1d8ad5a6f
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D
1 changed files with 2 additions and 2 deletions

View File

@ -650,7 +650,7 @@ func TestRoundTrip(t *testing.T) {
if err != nil {
t.Fatalf("Failed to parse response body: %v", err)
}
tok := strings.Trim(string(bs), "new token: ")
tok := strings.TrimSpace(strings.Trim(string(bs), "new token: "))
u = fmt.Sprintf("%s/foo", ts.URL)
body := strings.NewReader(`{"repo": "https://s.mcquay.me/sm/vain"}`)
@ -742,7 +742,7 @@ func TestForgot(t *testing.T) {
if err != nil {
t.Fatalf("Failed to parse response body: %v", err)
}
recTok := strings.Trim(string(ft), "new token: ")
recTok := strings.TrimSpace(strings.Trim(string(ft), "new token: "))
if iniTok == recTok {
t.Fatalf("tokens should not be the same; old token %s, new token %s", iniTok, recTok)