aptly icon indicating copy to clipboard operation
aptly copied to clipboard

Add a unique User-Agent HTTP header

Open Woellchen opened this issue 4 years ago • 2 comments

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?

Woellchen avatar Jan 08 '20 11:01 Woellchen

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.

joernheissler avatar Jan 13 '20 22:01 joernheissler

https://github.com/yaguangtang/aptly I modified based on the master branch, to support custom http headers.

yaguangtang avatar Nov 07 '23 09:11 yaguangtang