diff options
Diffstat (limited to 'internal/importer')
-rw-r--r-- | internal/importer/http.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/importer/http.go b/internal/importer/http.go index 6d60c44..b496177 100644 --- a/internal/importer/http.go +++ b/internal/importer/http.go @@ -6,6 +6,7 @@ import ( "log/slog" "net/http" "os" + "searchix/internal/config" "searchix/internal/file" "strings" "time" @@ -29,6 +30,8 @@ func fetchFileIfNeeded(ctx context.Context, path string, url string) (needed boo return false, errors.WithMessagef(err, "could not create HTTP request for %s", url) } + req.Header.Set("User-Agent", fmt.Sprintf("Searchix %s", config.ShortSHA)) + if mtime != "" { req.Header.Set("If-Modified-Since", mtime) } |