aptly
aptly copied to clipboard
Add a unique User-Agent HTTP header
Detailed Description
as of version 1.4.0 aptly is sending the following http header when mirroring repositories: User-Agent: Go-http-client/1.1
i would suggest changing this to something more unique, like Aptly/<aptly version>
so it can be identified (and possibly whitelisted) correctly
Context
i encountered one debian repository which has a few restrictions set in place specifically, it whitelists user agents (like apt's own one) to allow access i was able to convince the maintainer to whitelist the go header for now, but it would be much better to change the user agent so he can setup a proper whitelist again also this would generally benefit the world wide web imo
Possible Implementation
should not be hard, just globally set the User-Agent
header in the http client
i would even volunteer to implement this
what do you think about it?
Hello, I need to mirror a repository which whitelists one specific user agent. But my aptly installation mirrors several other repos and I don't want to use the special user agent for other repos.
I think a new default should be set which includes aptly
. And it should be possible to set a per-mirror User-Agent
. Or if that is too complicated, perhaps an environment variable could override it.
https://github.com/yaguangtang/aptly I modified based on the master branch, to support custom http headers.