Skip to content

ociclient: best place to inject User-Agent? #37

@tianon

Description

@tianon

I noticed today that nothing in my cuelabs.dev/go/oci/ociregistry/ociclient-using stack is setting User-Agent, so I'm hitting registries with Go-http-client/1.1, which is less than ideal.

To be clear, I'm not opposed to ociclient growing explicit User-Agent behavior of some kind, but I can totally understand why y'all might not want to do that! 😄

So the middle ground I'm proposing is an explicit reference somewhere in the godoc for ociclient for how to inject User-Agent correctly (and I'd even go so far as to make it a strong recommendation, at least for anyone connecting to registries they don't personally run).

I think the way to handle this given the existing API is a Transport/RoundTripper shim that injects it into every request, but I'm very open to being wrong. 🙇 ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions