neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
Log in to mark this repository.
Test a feed with the same headers the worker fetches it with
74f3450 · Gabriel Morell · 2026-09-07 04:47
Message
{commit_body(@commit)}
Files changed
modified
?
+0
−0
Binary file — not rendered.
modified
?
+0
−0
Binary file — not rendered.
modified
apps/room_gtfs/lib/room_gtfs/feed_tester.ex
+8
−1
| 57 | 57 | defp check_group({url, kinds}, source) do |
| 58 | 58 | base = %{url: display_url(url), kinds: kinds, entities: %{}, findings: []} |
| 59 | 59 | |
| 60 | − case RoomGtfs.Worker.RT.fetch_rt_url(url) do | |
| 60 | + # The source's own headers, because a feed behind an API key answers 403 to | |
| 61 | + # a request without one -- and a tester that reports "did not answer with | |
| 62 | + # HTTP 200" for a feed the worker fetches perfectly well is worse than no | |
| 63 | + # tester at all. It sends what the worker sends, or it is testing something | |
| 64 | + # else. | |
| 65 | + headers = RoomSanctum.Configuration.Configs.GTFS.request_headers(source.config) | |
| 66 | + | |
| 67 | + case RoomGtfs.Worker.RT.fetch_rt_url(url, headers) do | |
| 61 | 68 | {:ok, feed} -> |
| 62 | 69 | base |
| 63 | 70 | |> Map.put(:ok, true) |
Parents: 7753009