File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,7 @@ let collectLinks node =
3939
4040let exclusionCodes = Map.ofArray [|
4141 " https://www.lkokemohr.de/fsharp_godot.html" , HttpStatusCode.TooManyRequests // GitHub runner receives this often
42- |]
43- let userAgents = Map.ofArray [|
44- // Reddit doesn't like when we access it without any user-agent header.
45- // Note that this won't work for every other resource; e.g., X doesn't like whe we *pass* the user-agent.
46- " https://www.reddit.com/r/fsharp/" , " Mozilla/5.0 (compatible; +https://github.com/fsprojects/awesome-fsharp)"
42+ " https://www.reddit.com/r/fsharp/" , HttpStatusCode.Forbidden
4743|]
4844
4945let printLock = Object()
@@ -55,13 +51,7 @@ let checkLinkStatus (client: HttpClient) (url: string) = task {
5551 try
5652 lock printLock ( fun () -> printfn $" Verifying link {url}…" )
5753 let! response = retryPipeline.ExecuteAsync(
58- fun _ -> ValueTask< HttpResponseMessage>( task {
59- use request = new HttpRequestMessage( HttpMethod.Get, url)
60- Map.tryFind url userAgents |> Option.iter(
61- fun ua -> request.Headers.TryAddWithoutValidation( " User-Agent" , ua) |> ignore
62- )
63- return ! client.SendAsync request
64- })
54+ fun _ -> ValueTask< HttpResponseMessage>( client.GetAsync url)
6555 )
6656 if response.StatusCode <> HttpStatusCode.OK then
6757 return
You can’t perform that action at this time.
0 commit comments