Skip to content

Commit 04c10f7

Browse files
author
Shaan Sapra
committed
Fix tests against net/url error messages
See golang/go#29261. go 1.14 added quotes around error messages for net/url
1 parent 1977669 commit 04c10f7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

httpclient/http_client_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ var _ = Describe("HTTPClient", func() {
118118

119119
_, err := httpClient.PostCustomized(url, []byte("post-request"), func(r *http.Request) {})
120120
Expect(err).To(HaveOccurred())
121-
Expect(err.Error()).To(ContainSubstring("Post http://foo:<redacted>@10.10.0.0/path"))
121+
Expect(err.Error()).To(ContainSubstring("http://foo:<redacted>@10.10.0.0/path"))
122122
})
123123

124124
It("redacts passwords from error message for https calls", func() {
125125
url := "https://foo:[email protected]/path"
126126

127127
_, err := httpClient.PostCustomized(url, []byte("post-request"), func(r *http.Request) {})
128128
Expect(err).To(HaveOccurred())
129-
Expect(err.Error()).To(ContainSubstring("Post https://foo:<redacted>@10.10.0.0/path"))
129+
Expect(err.Error()).To(ContainSubstring("https://foo:<redacted>@10.10.0.0/path"))
130130
})
131131

132132
Describe("httpclient opts", func() {
@@ -378,15 +378,15 @@ var _ = Describe("HTTPClient", func() {
378378

379379
_, err := httpClient.PutCustomized(url, []byte("put-request"), func(r *http.Request) {})
380380
Expect(err).To(HaveOccurred())
381-
Expect(err.Error()).To(ContainSubstring("Put http://foo:<redacted>@10.10.0.0/path"))
381+
Expect(err.Error()).To(ContainSubstring("http://foo:<redacted>@10.10.0.0/path"))
382382
})
383383

384384
It("redacts passwords from error message for https calls", func() {
385385
url := "https://foo:[email protected]/path"
386386

387387
_, err := httpClient.PutCustomized(url, []byte("put-request"), func(r *http.Request) {})
388388
Expect(err).To(HaveOccurred())
389-
Expect(err.Error()).To(ContainSubstring("Put https://foo:<redacted>@10.10.0.0/path"))
389+
Expect(err.Error()).To(ContainSubstring("https://foo:<redacted>@10.10.0.0/path"))
390390
})
391391

392392
Describe("httpclient opts", func() {
@@ -529,15 +529,15 @@ var _ = Describe("HTTPClient", func() {
529529

530530
_, err := httpClient.GetCustomized(url, func(r *http.Request) {})
531531
Expect(err).To(HaveOccurred())
532-
Expect(err.Error()).To(ContainSubstring("Get http://foo:<redacted>@10.10.0.0/path"))
532+
Expect(err.Error()).To(ContainSubstring("http://foo:<redacted>@10.10.0.0/path"))
533533
})
534534

535535
It("redacts passwords from error message for https calls", func() {
536536
url := "https://foo:[email protected]:8080/path"
537537

538538
_, err := httpClient.GetCustomized(url, func(r *http.Request) {})
539539
Expect(err).To(HaveOccurred())
540-
Expect(err.Error()).To(ContainSubstring("Get https://foo:<redacted>@10.10.0.0:8080/path"))
540+
Expect(err.Error()).To(ContainSubstring("https://foo:<redacted>@10.10.0.0:8080/path"))
541541
})
542542

543543
Describe("httpclient opts", func() {

0 commit comments

Comments
 (0)