From 6580b4e76f288c2a2591f25bc916f7a728816609 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 15 Mar 2016 04:20:02 +0100 Subject: set user agent on fetch/import diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go index f501bc6..f53ed04 100644 --- a/rhimport/fetcher.go +++ b/rhimport/fetcher.go @@ -117,6 +117,7 @@ func fetchFileCurl(ctx *Context, res *Result, uri *url.URL) (err error) { easy.Setopt(curl.OPT_FOLLOWLOCATION, true) easy.Setopt(curl.OPT_URL, ctx.SourceUri) + easy.Setopt(curl.OPT_USERAGENT, "Radio Helsinki Import") cbdata := &FetcherCurlCBData{ctx: ctx, res: res, remotename: path.Base(uri.Path)} defer cbdata.Cleanup() diff --git a/rhimport/importer.go b/rhimport/importer.go index 952f75a..4473ee4 100644 --- a/rhimport/importer.go +++ b/rhimport/importer.go @@ -286,6 +286,7 @@ func importAudio(ctx *Context, res *Result) (err error) { easy.Setopt(curl.OPT_URL, ctx.conf.RDXportEndpoint) easy.Setopt(curl.OPT_POST, true) + easy.Setopt(curl.OPT_USERAGENT, "Radio Helsinki Import") var form *curl.Form if form, err = importAudioCreateRequest(ctx, easy); err != nil { -- cgit v0.10.2