Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.

Commit d352071

Browse files
committed
Show old links in report
Show links as http not https.
1 parent 8320277 commit d352071

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

httpsyet/crawler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ func (c Crawler) crawl(sites <-chan site, queue chan<- site, results chan<- stri
189189
}
190190

191191
if shouldUpdate {
192-
results <- fmt.Sprintf("%v %v", s.Parent, s.URL)
192+
s.URL.Scheme = "http"
193+
results <- fmt.Sprintf("%v %v", s.Parent, s.URL.String())
193194
}
194195

195196
urls, err := toURLs(links, s.URL.Parse)

httpsyet/crawler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ func TestRun(t *testing.T) {
171171
expect = fmt.Sprintf(
172172
"%s/base %s/page-a\n%s/sub %s/page-c\n",
173173
pageServer.URL,
174-
tlsServer.URL,
174+
strings.Replace(tlsServer.URL, "https", "http", 1),
175175
pageServer.URL,
176-
tlsServer.URL,
176+
strings.Replace(tlsServer.URL, "https", "http", 1),
177177
)
178178
eqLines(t, expect, out.String(), "unexpected output")
179179

@@ -257,9 +257,9 @@ func TestRunSingle(t *testing.T) {
257257
expect = fmt.Sprintf(
258258
"%s/base %s/page-a\n%s/sub %s/page-c\n",
259259
pageServer.URL,
260-
tlsServer.URL,
260+
strings.Replace(tlsServer.URL, "https", "http", 1),
261261
pageServer.URL,
262-
tlsServer.URL,
262+
strings.Replace(tlsServer.URL, "https", "http", 1),
263263
)
264264
eqLines(t, expect, out.String(), "unexpected output")
265265

0 commit comments

Comments
 (0)