diff options
Diffstat (limited to 'internal/liturgy')
| -rw-r--r-- | internal/liturgy/fetch.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/liturgy/fetch.go b/internal/liturgy/fetch.go index d6cc4b6..5447552 100644 --- a/internal/liturgy/fetch.go +++ b/internal/liturgy/fetch.go @@ -15,6 +15,13 @@ import ( // It is a package var so tests can point it at an httptest server. var baseURL = "https://niezbednik.niedziela.pl/liturgia/%s/Ewangelia" +// SetBaseURL overrides the fetch URL template used by Load. It exists so +// tests in other packages (e.g. internal/readings) can point Load at an +// httptest server; production code must never call it. +func SetBaseURL(url string) { + baseURL = url +} + // userAgent is sent on every fetch; the site serves a different (broken) // page to non-browser clients without it. const userAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 " + |
